Delete of functions and void * accepted without warning by compiler

Program:
extern "C" int sync();
void f() { delete sync; }compiles fine.
This also compiles fine (CC -c s.cc +w2):
void f(void *p) { delete p; }
void g(void *p) { delete [] p; }gcc4 gives for first program:
t.cc: In function 'void f()':
t.cc:2: error: cannot delete a function. Only pointer-to-objects are valid arguments to 'delete'
For the second program it gives:
s.cc: In function 'void f(void*)':
s.cc:1: warning: deleting 'void*' is undefined
s.cc: In function 'void g(void*)':
s.cc:2: warning: deleting 'void*' is undefined
I am not a language lawyer, but gcc treatment seems better.
Some refactoring of our code had left a delete sync; in our code after the pointer sync had been removed. It was some work to find out why the program crashed.

According the the C++ Standard, the program results are undefined if you attempt to delete a pointer that was not obtained from a corresponding "new". The compiler is not required to detect errors.
But attempting to delete a function pointer can never be correct, so gcc is being more helpful than Sun C++ in telling you about it.
If you file a report at bugs.sun.com, you can track progress on getting this enhancement into the compiler. If you don't want to file the bug, let me know, and I'll file one myself.

Similar Messages

  • Photoshop CS4 crashes and shuts down without warning.

    I have installed the new CS4 upgrade, and I have disabled the GPU. I have just upgraded to 2MB of RAM. However, PSD CS4 will suddenly shut down without warning at unpredictable times - yesterday it happened when I zoomed in past 200% - today it happened when I hit Save For Web. Really annoying. Any ideas?
    Thanks
    Charles

    Look in the Photoshop forum. This is for Premiere Pro.

  • I deleted AE CS6 and AE CC without uninstalling them, and am trying to re-install, and Adobe Application Manager must think that they're still there, and won't re-install them, either via DVD or via cloud.

    How can I re-install AE CS6?
    (I've had the cloud for about a year and a half, and recently purchased CS6.)

    Hi Brej,
    You stated that you deleted the apps and didn't uninstalled them. This is the reason you see these apps installed.
    Follow the instruction @ http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html , which help you to resolve the issue.
    Thanks,
    Manish Sharma

  • ITunes opens and re-opens without warning

    Here's the deal.  This has been going on for a while now but it's now starting to become a problem.  Every time I close iTunes, it decides to open itself up again and the only way to keep it closed is to ctrl+alt+delete and close it via the processes tab.  But now a new, rather irritating issue has come up.  Now it decides to open at will every time I go into my itunes folder.  No warning and no explanation, it just does.  I have looked for fixes and nothing has worked.  I have no widgets or gadgets that would cause make this happen and I have done several tests reguarding my keyboard and related apps (including shutting off the apps and unplugging the keyboard) and the same thing happens so I have reason to believe that is not the confliction.  I have tried doing a clean install but that was a bust as well.  If anyone knows of why this happens or knows how to prevent it, please let me know.
    If it helps, I have the latest version of itunes x64 (or whats claimed on the apple site as the 64 bit version but windows still reads it as a 32 bit executable) and all the updates for windows 7 Professional x64.

    wow.  I don't quite understand why keyboard software would make this happen, but that is a darn shame that this is the exact case.  especially when all the other media players I have on my computer, even Windows Media, doesn't act like this.  Guess I'll just have to make due and live with it because I really like the software.  Thanks for clearing this up for me.

  • PlayBook battery level warning does not always work and shuts down without warning

    My BlackBerry PlayBook, operating on the new OS2, annoyingly shuts down at 12% battery life without any warning if I have anything open.  If open applications are reduced so that the desktop is visible, the PlayBook will alarm at 9% and and continue to run below this figure.   Does anyone have a solution to this or experienced this issue?  Thank you.

    Your Macbook is still under warranty.
    I would call Apple Support and see what they recommend. You don't have to purchase the AppleCare unless you want to.
    You have another choice.
    You can buy a new battery and see if that works for you.
    http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?mco=F80 3127E&nplm=MA561G%2FA
    Then you could take in the original battery and have it checked out under warranty.
    Of course, you would probably end up with two batteries in the end but sometimes that is a good thing depending on how much you travel.
    You might also want to see this post:
    http://discussions.apple.com/message.jspa?messageID=3963944#3963944

  • Uninstall Delete World Book and Garage Band without problems i.e Iphoto

    With only 30GB, I want to free up space. I am concerned that by just dragging these two files to the trash, I will have problems (as mentioned in other discussions).
    Can someone tell me "definitively" how to accomplish this without problems. According to the info on file report, these two programs and associated files take up probably 3-4 GB.
    Thanks so much in advance for any guidance.
    Skip

    Skip
    I know of no problems with iPhoto and trashing World Book.
    Hwever, some folks have had problems with iPhoto when Garage Band is trashed - it fails to launch.
    My suggestion is to keep Garage Band (the app itself, minus language resources is only about 80MB) but by all means trash the associated Sound Loops - which is where the Gigs of space go. In fact, trashing the app won't remove these - they're in an Application Support Folder.
    Regards
    TD

  • Thunderbird automatically updated to version 24.6.0. It deleted all of my saved emails without warning me. Can I recover these????

    How can I recover these saved emails???

    It was like I was starting Thunderbird for the first time. Created the new accounts, although it did pull all the account information over. Just upset that it didn't warn me to back up everything. Had several important emails sitting in my inbox. Went to open Thunderbird and got the message of "Please wait, installing updates". When it opened everything was gone......

  • I am unable to update CC. It's starts ok and then stops without warning or message My Adobe ID does not show that I am a CC subscriber

    My Adobe ID does not show that I am a CC subscriber

    Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    If yes
    Some general information for a Cloud subscription
    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html
    If no
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • IPad and iPhone restore without warning

    My iPhone5 running ios 6.1.4 and iPad running iOS 6.1.3 have both restored themselves.  The phone was a few days ago and the iPad today.  Went to turn them on after charging overnight and the start screen was showing just like a new device.  I searched forums but couldn't find similar problems except developers using beta firmware versions which is definitely not me. I'm a simple user with very limited knowledge of how these things work. Fortunately I'm at home so can restore all the data from my PC but I travel a lot and this could have been a disaster if it happened while away.  Anyone experienced the same issue? Is it likely to happen again?

    OK, I've done some testing and this is what I found. The iBooks app will sync your iPhone and iPad wireless when they are connected to the same wi-fi network. It will sync your categories and bookmarks. I found I could read a magazine on my iPad and when I opened it on my iPhone it was on the same page that I stopped at on my iPad. Great feature I think.

  • Service entry and Acceptance without service PO

    Hi,
    Is it possible to create Service entry sheet and service Acceptance without service PO ?
    if yes Please suggest the Steps.
    Regards,
    Rani

    Hi,
    It is not possible to create service entry sheet and service acceptance without service PO.
    After creating Service PO only create service entry sheet and acceptance display in SAP.
    Hope, it is clear for you.
    Regards,
    K.Rajendran.

  • HELP, my macbookpro reboots without warning

    Sometimes, while i use the trackpad, either dragging one file or selecting multiple rows, the macbook pro reboots.
    The only thing in common to all reboots is that the system freezes for 4-5 seconds and then reboots without warning. console doesn't report anything. it has always happened while using the trackpad, but i seldom use the mouse, so i can't say if this would happen with the mouse too. Also, it happens when i use the trackpad one-handed, holding the button with my thumb and dragging with another finger.
    When the system reboots it takes longer than usual.
    Any idea? how can I find out what is wrong without reformatting the whole thing??
    Thanks
    Andrea

    Take a look at this thread:
    Is my P.S. the problem?
    I had a similar problem.  I'll bet you are experiencing a stop error called MACHINE_CHECK_EXCEPTION.  I causes a very fast reboot once the blue screen appears.  I posted a link in that thread to the explanation on the Microsoft website.  
    There's a couple of potential causes, including an insufficient power supply, incompatible RAM, processor too far out of spec (OCd) or high temperatures.  I'm pretty sure my problem is due to the PS...  hope this helps you narrow down your troubleshooting some.  
    Its my understanding that only a couple of passes of Memtest will be sufficient in this case to verify RAM compatibility, because any more than that and the power supply will become stressed (remember increasing heat in the PS decreases its efficiency), possibly confounding your little experiment...

  • I deleted my recovery and hptools partition

    hi
    By mistake i deleted my recovery and hptools partition without creating a recovery disc. The disc which i got along with the pc says drivers and software but it only has operating system
    laptop model hp probook 6560b
    operationg system window 7 proffesional 64

    Satellite L755-S9530WH (PSK2YU-091023)
    Probably this one in white color instead of silver. Right?
    Satellite L755-S9530D  (PSK2YU-08X023)
    what should i do to get the recovery partition back? ... get back all the HDD space on one partition C the way i bought it
    Restore the hard disk to its original out-of-the-box contents using the Toshiba recovery discs.
    Before doing that, back up the data drives.
    If you insist on creating an additional partition, shrink the C partition and put it in the space created. Best to use a third-party tool.
    -Jerry

  • Passing Partner function and Partner number in Action container editor

    Hi all,
    We have a requirement to create a follow up transaction with different business units as partner functions depending on some logic. I tried defining one action using copy_document method and was able to pass the container values of partner function (CRMT_PARTNER_FCT) and partner number (CRMT_PARTNER_NO) along with transaction type (process_type). However, still the follow up transaction does not contain the relevant partner function and value.
    Please let me know is there a way I can default differnt partner function and partner number while creating a transaction based on my actions.
    Thanks and Regards,
    Varun Gupta

    Thanks maggie, I know couple of options using code like the one you mentioned in copy badi. There is another BADI only for partner function. I can activate it in the access sequence and can do my code over there. However, in actions (copy_document specifically) we can pass parameter like transaction type, activity category etc. SAP standard implementation automatically takes those parameter into consideration and create subsequent transaction with right transaction type and activity category. On similar basis I have also tried sending partner function and partner number without any success. So I thought of raising this and need all CRM experts advice on it.

  • Drop  all functions and procedures

    How can I delete all functions and procedures by using Native Dynamic SQL

    Loop against DBA_OBJECTS for the object_type and owner you want to delete.
    For each loop, build your query into a variable, then execute it.
    http://tahiti.oracle.com/pls/db102/drilldown?levelnum=2&toplevel=b14261&method=FULL&chapters=0&book=&wildcards=1&preference=&expand_all=&result_id=1662311&verb=&word=execute+immediate#b14261
    Nicolas.

  • How to delete multiple songs from iPhone 5S without losing form iTunes? The unchek function has not worked. Why?

    How to delete multiple songs from iPhone 5S without losing form iTunes? The unchek function has not worked. Why?

    Sorry I had to reply through your profile Gail from Maine, my PC has java issues. In any event, when I delete them directly from my device everything is perfect and cool. However, in the rare instance I want to add new music that I actually buy in stores (I know, quite the unique and old-fashioned idea...but hey Im an audiophile) once I upload the tunes, everytime I sync my library it re-adds everything that I spent hours deleting. In a perfect world, I thought I could maintain a massive iTunes Library, and add or delete (remove) songs from my iPhone to save both memory or keep my iPhone selections more current/apt to my musical "tastes" at that time. I know about the whole playlist thing, but thought there might be an easier way. ie - checking/un-checking the little box next to the song name, and then doing a sync. Again, everytime I do this however, whether everything is checked or un-checked it adds the entire library! So frustrating. Any suggestions. Thank you graiously in advance for your help.

Maybe you are looking for

  • Editing one row at a time in a table control

    Good day all I need your urgent assistance with the problem below: At first time load, the table control needs to allow input on the first line only, validation will then be done through clicking a "check" button.  After the check has been done, tabl

  • Error when launching Firefox

    Hi; I'm experiencing a problem when launching Firefox . Receive the following message; Firefox can't establish a connection to the server at en-gb.start3.mozilla.com I've removed and reloaded Firefox, but same problem. The only thing I can think of t

  • Change pointers of IDoc

    Please conduct a simple question. T-code BD52 is Maintain change-relevant fields for message type,the first column is 'Object', the contents of this column can be maintained in where? Thanks a lot.

  • Option disabled Insert in personal list in MM03 search

    Hi All, I am trying to get the option of "Insert in Personal list" while doing material search in MM03 and it is not enabled for me. But the same is enabled for my colleague. We both are using same GUI version 720 and same user settings but still tha

  • Removing extra character

    Hello, I have a textbox and a button in flash.  I send data to java server by entering data into the textbox.  Firsttime the number of characters i am receiving are correct, from the second time onwards there is an extra character.  i.e if i type 1 c