Help!!  CC mangling works confusing!!

I have confusion about how CC mangling works for C code. Could you please give me a rule about when the mangling will be effect on the funcion?
In the following scenario, all three functions have been declared by extern "C" in queue.h, queue and queue2 have the same defination, but the queue2 has been declared again in queue.C.
Scenario:
bash-3.00$ more queue.h
extern "C" {
int queue(char q, void (*df)(void * object));
int queue1(char q, char *df);
int queue2(char q, void (*df)(void * object));
bash-3.00$ more queue.C
#include <stdio.h>
#include "queue.h"
int queue(char q, void (*df)(void * object))
printf("Test\n");
return 0;
int queue1(char q, char *df)
printf("Test1\n");
return 0;
extern "C" {
int queue2(char q, void (*df)(void * object))
printf("Test\n");
return 0;
queue.C
int queue(queue_str q, void (*df)(void * object))
     print "Test\n";
On Solaris10 on x86, Sun Studio 11:
I compiled it by: C -w -c queue.C
Then
bash-3.00$ nm queue.o
queue.o:
[Index] Value Size Type Bind Other Shndx Name
[6] | 0| 0|SECT |LOCL |0 |6 |
[2] | 0| 0|SECT |LOCL |0 |2 |
[3] | 0| 0|SECT |LOCL |0 |3 |
[4] | 0| 0|SECT |LOCL |0 |4 |
[5] | 0| 0|SECT |LOCL |0 |5 |
[7] | 0| 54|FUNC |GLOB |0 |2 |__1cFqueue6FpcpFpv_v_pi_
[8] | 0| 0|FUNC |GLOB |0 |UNDEF |printf
[1] | 0| 0|FILE |LOCL |0 |ABS |queue.C
[9] | 64| 54|FUNC |GLOB |0 |2 |queue1
[10] | 128| 54|FUNC |GLOB |0 |2 |queue2
My question is why the function queue was mangled, but the queue1 and queue2 did not? I am appreciated for your response. Thanks!

For a discussion of name mangling, see my paper "The stability of the C++ ABI"
http://developers.sun.com/sunstudio/articles/CC_abi/CC_abi_content.html
In a C++ program, any function not declared extern "C" winds up with a mangled name. The reason is that the compiler must allow for the possibility that a different function with the same name might be defined in another part of the program and not seen by this compilation.
When you declare a function extern "C", you specify that the function follows the C rules for linkage (the external name seen by the linker, parameter passing conventions, etc). In particular, C does not allow more than one global function with the same name, and names are not mangled. Only one function with a given name can therefore be declared extern "C".
As Simon already explained, you generally need to be consistent about declaring and defining a function as extern "C".

Similar Messages

  • Linking an LOV to a form in webDB 3.0 and getting the help files to work ?

    Hi All I can link an LOV to a form in webDB 2.2 I can link an LOV to a report in webDB 3.0 but I cannot seem to figure out how to link an LOV to a form in webDB 3.0 can anyone help me ?
    Also I can't get the help files to work I get the message : Database Log In Failed ?
    null

    quote:
    Originally posted by:
    kglad
    lol, flash was confused?
    Ok... maybe I caused some confusion? In my nested MC, first I
    added some animation and keyframes and THEN I went back to name the
    instances. This caused multiple instances with the same name along
    my timeline thus "cunfusing" flash.
    My bad!
    live and learn! (hehe)
    Pat

  • PSE 10  and Adobe CS6: When running silent install help is not working afterwards

    Hello,
    I'm not sure if this is the correct forum. If not: Please help me find the correct one.
    I have a big issue with Adobe CS6 (and former versions like Photoshop Elements 10): When installing it from DVD running GUI everything is working fine afterwards. If I install e.g. Photoshop Elements 10 using "Silent Installation" help is not working afterwards. It states that it cannot locate the URL. I have not installed AIR and also do not plan to install it.
    I have 'played' a little around with Common Files\Adobe\helpcfg and help directory. Now at least I do not get an error message but still it's not the online help which opens in the browser but the web page that is defined as 'home'.
    The same I see now in Adobe CS6. I have e.g. packaged After Effects and Illustrator and when deploying it I'm not able to open help as well and I fear that this is the same issue.
    Has anyone deeper knowledge about how "helpcfg" is working? Any example files? Any other help appreciated as well.
    Kind regards
    János

    @hannilator Have you checked the exceptions folder contents for instructions on how to push to logged off computers? Here's what I get when I package CS6 (DesignWebPrem) and excude AIR/CHC:
    After you have deployed the package, separately install the products in the exception folder.
    IMPORTANT: Before you install the products in the exception folder, refer to the following Adobe Knowledgebase article for information on installing these products and configuring the settings correctly:
    http://www.adobe.com/go/aamee_exceptions
    NOTE: The installation commands provided below will work when the user is logged in to the client machine where the package is being deployed. For the scenario where the user is not logged in, prefix the following string to the command:
    sudo launchctl bsexec `ps auwwx |grep [l]oginwindow | awk '{ print $2 }'`
    As an example, here is the command to install "Adobe AIR" when the user is not logged in to the client machine (assuming Adobe AIR is part of the package):
    sudo launchctl bsexec `ps auwwx |grep [l]oginwindow | awk '{ print $2 }'` Adobe\ AIR\ Installer.app/Contents/MacOS/Adobe\ AIR\ Installer -silent
    ###################################### Command to install Adobe Dreamweaver Widget Browser ######################################
    Adobe AIR Installer.app/Contents/MacOS/Adobe AIR Installer -silent -eulaAccepted -programMenu WidgetBrowser.air
    ###################################### Command to install AdobeHelp ######################################
    InstallAdobeHelp appVersion=4.0.244 appId=chc pubId=4875E02D9FB21EE389F73B8D1702B320485DF8CE.1 installerArg1=-silent installerArg2=-eulaAccepted installerArg3=AdobeHelp.air

  • Upon upgrading iPhoto, iPhoto Help no longer works.  It gives the error message:  "The selected topic is currently unavailable. To see all iPhoto Help, you must be connected to the Internet." Help!?

    Upon upgrading iPhoto, iPhoto Help no longer works.  It gives the error message:  "The selected topic is currently unavailable. To see all iPhoto Help, you must be connected to the Internet."   I am obviously connected to the internet since you are reading this.
    I tried upgrading permissions but it did not help!?  Can anyone tell me what is wrong?  Thanks

    Try
    Reboot the computer, see if that fixes it.
    Then try:
    Backup your files off the computer (not TimeMachine) and disconnect
    Hold c boot off the 10.6 disk and simply reinstalling OS X
    Log in and update to 10.6.8
    c boot off the 10.6 disk again and use Disk Utility >Repair Disk
    reboot and all should be fine, except some third party programs that install kext files, those will have to be reinstalled from fresh sources.

  • Since updating to I.O.S7 on my ipad2 all i get when i turn it on is a loading screen with a picture of a charger going into an ITUNES sign? HELP nothing will work not interactive at all?

    all i get when i turn it on is a loading screen with a picture of a charger going into an ITUNES sign? HELP nothing will work not interactive at all.aince updating to I.O.S7.0.2???
    What should i do currently have it on charge for several hours not done a thing and have been locking and unlocking and resetting

    Please see: http://support.apple.com/kb/HT1808 for further info.  It sounds like you are already in Recovery mode so if the image in Step 4 is the one you see, skip to Step 5.
    Regards,
    Steve

  • WBS element field in transaction CS71-F4 help is not working in ECC 6.0

    Hii
    In SAP, while working in SAP 4.7, tcode cs71, WBS element is coming via F4 Help. But after upgradation to ECC 6.0 EHP 5, this F4 help is not working. I can enter value manually.but F4 help is not working.
    Please Help.

    Hi,
    You can do it manually too
    1.  Choose function group 'CSDI' via Transaction SE80.
    2.  Choose screen '0260'in the 'Screens' area and switch to change mode
    3.  Choose the 'Element list' tab index.
    4.  In this area, choose the 'Reference' tab index and enter the value
        'PRP' in the 'Search help' column in the line for field
        'RC29N-PSPNR'.
    5.  Save your change and regenerate the screen.
    6.  The correct input help for the WBS element is now available in the
        initial screen of Transaction CS71/72/73.
    I hope F4 helps works for "Existing WBS BOM's" in CS71 after this
    Refer to Note : 714824 as well , it has reverted back the changes done by note : 422265
    Regards
    Gaurav

  • The 'Content, index, search' section of my help is not working in Mozilla

    Dear All,
    The 'Content, index, search' section of my help is not working in Mozilla.
    I am using robo8 and mozilla 8. Any idea? please help...
    Regards,
    Jobin.

    Dear William,
    It is a webhelp
    It is working in all other browsers except Mozilla.
    It is a merged help...
    waiting for your reply..:)
    Regards,
    Jobin.

  • F4 help is not working in IAC Iview

    Hi,
    There is IAC iview for transaction PA61
    F4 help is not working for the iview
    it workes in backend SAP PA61
    kindly give any hints what can we check
    thanks in advance
    b

    Hi,
    This might be due to the JRE version of the browser. We faced such issue and the update of JRE version in the browser helps to get the pop-up of F4 help. Check in the internet broswser Tools -> Internet Option -> Advanced. Check whether the JRE applet is checked or not. it has to be checked. if it is checked and even if you dont get the F4 help, upgrade the JRE version.
    Thanks,
    Mahendran B.

  • Help is not working in Hyperion System 9 WebAnalysis

    two months back we have installed Hyperion System 9.2.0.3 BI+ server and is working fine. however recently one user complained that WebAnalysis help is not working.<BR><BR>we are getting "page cannot be displayed" when clicking on Help --> contents and index from WebAnalysis -- <a target=_blank class=ftalternatingbarlinklarge href="http://hostname:19000/WenAnalysis">http://hostname:19000/WenAnalysis</a><BR><BR>this is the direct link to the webanalysis help <BR><a target=_blank class=ftalternatingbarlinklarge href="http://hostname:19000/workspace/docs/en/wa_user/frameset.htm?/workspace/docs/en/wa_user/launch.html">http://hostname:19000/workspac...n/wa_user/launch.html</a><BR><BR><BR>Do you know how to fix this?

    Hi Friends,
    I am working on Sandbox Server, in that Help (F1) is not working. When i try to click F1 system is opening the popup and showing the following message-
    The page cannot be displayed
    Plz help
    Regards
    Goutham

  • With input disabled field search help is not working.

    Hi Web dynpro abap Gurus
    Please help me on below requirement.
    If i make a input field disable then the attach search help is not working. Is there is any way by which
    I can make input field disabled and search help will also work for this field.
    I really need help on this, Please help me.
    Many thanks in advance.
    Sandeep Sharma
    09971995045

    Hi
    I dont think that a field can be disabled and allows to choose data using f4 simultaneously. you can enable the field and allow the user to select whatever he/she wants.
    Then in any action like on press of save or submit button which the user will trigger after entering the values, get the value entered by the user in that perticular field and fire a query on the table/view, which you have used as selection method of your search help, it help is coming from data element then look for check table in domain. if sy-subrc comes 0 than go ahead else give error that value selected is modified.
    Thanks
    Vishal

  • How do I print multiple copies of the same photo on one page or a contact sheet. The directions in help don't work

    I want to print multiple copies of the same photo on a page. The directions in help don't work
    Help

    What version of iPhoto?
    The general process is to select the photo and print, select the printer, paper size and print size and click customize and under settings selec multiples copies of a photo (the preview will reflect this choice) and click print to print, make any printer specific selections and click print to print
    LN

  • "Help" doesn't work after update

    After updating to 10.4.4, I can no longer get the "Help" directory to work. I enter a topic, and the machine searches for ever. Anyone with a similar problem or solution?
    eric

    Eric,
    Welcome to Apple Discussions.
    Troubleshooting Help Viewer by Dr. Smoke may be "Helpful."
    ;~)

  • Error while creating my first  project on SP15 and why Help doesn't work?

    Hello sdnrs,
    I have a fresh SP15 installtion.
    I have 2 problems creating my first webdynpro project.
    1.When I go to file-new-project-webdynpro->(enter name)->next ,  I have windows poped up with the following error:
    Plug in name: Web Dynpro Archive Builder
    Plug in id: com.sap.ide.webdynpro.archivebuilder
    class: com.sap.ide.webdynpro.archivebuilder.project.WebDynproStandaloneProjectWizard
    Method: createJavaProject(IProject, IProgressMonitor)
    Message: Problems encountered while setting project description.
    Exeption: org.eclipse.core.runtime.CoreException: Problems encountered while setting project description.
    I am frustrated cause I can't do any step futher...! Is there any special settings on the SDK, Window-Preferences, etc?
    2.My Help doesn't work at all - it used to be (with SP11 slim) when i go - 'Help-SAP was docum-SAP webdynpro appl ' and I had my help window poped up.Now I dont have anything!
    Thank you much in advance!
    Bob

    For your information there's another solution if you don't wanna reinstall your NDS or if the reinstallaion doesn't work.
    The error is in the resources so you have to replace some plugin resources to correct the error. Because of that you need access to the resources from somewhere else.
    1. Go to c:\Documents and Settings\"username"\Documents\SAP\workspace\.metadata\.plugins and replace org.eclipse.core.resources with a "working" resource
    2. Go to C:\Program Files\SAP\JDT\eclipse\plugins and replace org.eclipse.core.resources.win32_2.1.0 and org.eclipse.core.resources_2.1.1 with a "working" resource.
    Restart NDS and it ought to work
    Best regards,
    Ole Mose

  • PLEASE HELP!!! My 'Apple mobile device helper has stopped working'!

    Today i bought the new 3G iPhone so i went online to download the new 7.7 iTunes software. Now when i go into my iTunes a Windows pop up appears telling me that my 'Apple mobile device helper has stopped working' and that it is diagnosing the problem. The thing is that it doesn't diagnose the problem, the same box just keeps popping up over and over again.
    I am not very computer literate and have tried everything that i can think of but nothing has worked.
    Please can someone help because i'm absolutely dying to use my new iPhone; i queued up from 6 am to get my hands on it! :0(

    I'm just a simple user. I don't know how to fix it any more than any of the other posters with this problem. I've looked around in control panel, done some poking and prodding with services and processes, and can't find a reasonable way to stop the messages without completely hosing up iTunes. I know the messages are annoying as ****, and nobody likes the idea, but sitting around and doing nothing is sometimes a whole lot better then doing something that makes it worse. See if you can find a document from Apple that tells you how to go back to the previous version of iTunes. I've seen that course of action mentioned several times for previous releases of iTunes upgrades, so the instructions for it must exist in another forum.
    I just think, from the number of posts, that Apple is going to have to get a fix out pretty quickly, because this error pretty much shuts down their products on the Windows platform. They can't afford to let it go on for very long.

  • "Mobile Device helper has stopped working" after installing most recent

    OK. Like a thousand other threads that have been posted over the past week or so on this topic and having tried most of the suggestions, I find myself at a loss.
    After most recent update (which I installed on Monday) from 3.1.2 to 3.1.3 all **** has broken loose between my *iPhone, iTunes & Outlook*. This all came to light just hours after the install. . . . I noticed that my phone wasn't syncing - at all, it just "hung" there then I went into my contacts in Outlook - gone. . . UGH, EEK, OK, so they're still on my iPhone BUT I can't get to them in Outlook. After loosing most of yesterday and all of today I am at the mercy of someone who might know how to resolve this issue.
    _*Steps I have taken :*_
    I have un-installed and reinstalled iTunes 5 times, no luck, I've restarted, yada yada yada. I've hidden my Norton's Internet Security, allowed iTunes, etc. *Still no luck*. Take in mind, all was great after months of perfect syncing, etc. no problems whatsoever . . .
    *The two messages that I continue to get when I open iTunes and connect my phone:*
    1) "Mobile Device helper has stopped working"
    2) " Unable to load data-class information from Sync Services. Reconnect or try again later".
    The most recent error message under "Problems Reports & Solutions" on my start menu read:
    Product: MobileDeviceHelper
    Problem: Stopped working
    Date: 4/7/2010 3:42 PM
    Status: Not Reported
    Problem signature
    Problem Event Name: APPCRASH
    Application Name: AppleMobileDeviceHelper.exe
    Application Version: 16.691.14.1
    Application Timestamp: 4ba3b8fe
    Fault Module Name: CoreFoundation.dll
    Fault Module Version: 1.550.17.21
    Fault Module Timestamp: 4b8cb530
    Exception Code: c0000005
    Exception Offset: 0000db6b
    OS Version: 6.0.6002.2.2.0.768.3
    Locale ID: 1033
    This is the same message that I have received the last 10 times under Mobile Device Helper.
    *Please PLEASE please*, does anyone know how to resolve this problem?
    *Thank you SO MUCH for any insight.*
    -signed, UGH!!!

    Hi,
    I have had the same experience... uninstalled and reinstalled iTunes and all Apple components only to now be in a position where I can't sync my iphone at all (before I started trying various solutions I could still sync music... now nothing!) and I continually get the messages "mobile device helper has stopped working" and then "iTunes was unable to load dataclass information from Sync Services. Reconnect or try again later".
    I even tried reinstalling iTunes 9.0 but somehow I don't have the old library saved - means I lose all the ratings, playlists etc.
    Really frustrating and disappointing.

Maybe you are looking for

  • Crystal Report throws Unexpected Database Connector error

    Hi,<br> <br> We are using Crystal report 2008 CR4E API to implement the crystal report in our application. We use the below code to reset the report data source with our application data source. It works fine for most of the simple queries. But if th

  • How to get OGG format in Logic Studio

    How to get OGG format in Logic Studio

  • Gather distribution_name stopped with error: Login failed

    Does anyone know what this error means....? I'm getting it on one distribution I have. I've looked thru the KB and googled it, and can't find anything that really applies. Graham

  • Oracle 9i for Redhat Linux 9

    Hi I have a P-III, 1Ghz 128MB RAM, 40GB HDD pc. There are two OS installed in it,i.e., Win200(prof)and Redhat Linux 9. As I am undergoing a course in Oracle 9i DBA, I have installed a copy of Oracle 9i Enterprise Edition in my Windows partition and a

  • RFID Tags and Readers

    I would like to know the implementation/development process of RFID Tags and Readers. Is there any referece hardware architecture by which i can develop RFID readers with CDC/CLDC kit and use Java RFID software. Or is there any RFID tag and reader re