__VA_ARGS__ does not expand correctly when no argument is given

It seems that there is a bug in expansion of __VA_ARGS__ for variable argument macros.
test1.c
#define debug(arg1, ... ) myfunc(arg1, __VA_ARGS__)
main() {
int i;
debug(i)
debug(i,i);
preprocessed output
bash-3.00$ cc -E testvar1.c
# 1 "testvar1.c"
# 3
main() {
int i;
"testvar1.c", line 7: warning: argument mismatch
myfunc ( i , )
^^^
myfunc ( i , i );
#ident "acomp: Sun C 5.8 Patch 121015-02 2006/03/29"
Notice the extra comma after the first argument in the first invocation.
Is this a bug or am I using it wrong?

Variable-argument macros are not officially part of C++. Sun C++ uses the C99 definition of variable-argument macros, which is likely to be adopted into the next C++ standard.
The C99 Standard says in the "Constraints" part of section 6.10.3, "there shall be more arguments in the invocation than there are parameters in the macro definition (excluding the ...)."
You can have a fixed argument in the macro definition
#define debug(arg1, ...) <something>
but you must have at least 2 arguments in each invocation.
if you want to be able to invoke the macro with one argument, the macro definition cannot have any fixed arguments.
The rule is different than for variable-argument functions. For variable-argument functions to work, the called function must have a first parameter of known type so that it can find the remainder of its arguments. There is no such problem for macros. Macro arguments do not have types, and the macro is completely expanded at compile time.
Message was edited by:
clamage45

Similar Messages

  • TOC in French version of webhelp does not expand correctly

    I have a RoboHelp project (RH 8.0.2.208) created by importing an HTML Help project that I use to generate WebHelp. The HTML files, the .hhc, .hhk, .hhp files have been translated to French (from English). I have changed the language in the project settings to French (France) and I generate the WebHelp output. All appears to process correctly except the TOC does not expand and collapse correctly. Some first level entries expand with one click (as expceted), some entries only expand after other entries have been expanded, and some entries will not expand at all, and once expanded, some entries will not collapse.
    I have used the same process to generate other language versions and have not had the same issue. I have been searching the forum to see if similiar issues have been reported but cannot find anthing similar.

    I had something a bit similar with RH 7, except it wasn't limited to one language but Firefox browsers. That problem was solved by installing the latest RH patches. You have a later version of RH and the problem is only in French, so the problem is most likely in the French help project.
    What I'd do to troubleshoot it: Make spare copies of the help projects, just in case you make it worse and not better.
    use a comparison tool like Beyond Compare, to compare the .hhp, .hhc and .js files between the French and English projects: any unexpected differences that are not language related? If there are unexpected differences in tags or other functional items, copy those items from the good project. Rebuild the project by opening the .hhp file.
    or
    Assuming your projects use the same file names for everything, copy the French .htm, .hhc and .hhk files into a spare copy of the English project. Open the project normally and change the language setting and help title (the .hhp should not have any other translated texts than the help title).
    It can happen that a translation agency does something to the translated files, that does not work in your system. It can be very obvious in a side-by-side comparison, in a comparison tool or just Notepad, or it might be a bit more hidden like wrong character encoding.

  • Oops - spry menu bar 2.0 does not display correctly when loaded

    Oops - obviously I'm new at this. I think I got my graphics loaded now.
    Dear Sirs:
    I notice bzz31 had a pretty complicated post, so perhaps someone can help me with my complicated problem that has been vexing me for months. I tried the Spry Menu Bar 1.0, but it was impossible for me to edit, and I was delighted to see Spry Menu Bar 2.0 come out. However the 2.0 version has been frustrating me as well.
    I can get my menu bar to display properly in Live View, as shown below.
    However when I load everything onto the server, the menu bar does not display correctly, as shown below:
    I don't quite understand the code "file:///" but I interpret it to mean that the Spry-UI-1.7 folder is in the topmost folder of MacPro5-Docs, which is my hard drive. Here's the code I'm having trouble with:
    Here's my computer directory, shown below:
    Since my index file is two folders down from Spry-UI-1.7, I loaded the files onto the server similarly, as shown in the next three pictures:
    (The picture below is the same as the one just above, but now you can see the path from index to Spry-UI-1.7.)
    I would be most appreciative if someone can help me.
    Thank you.

    Have a look at the following links
    <script src="file:///MacProG5-Docs/Spry-UI-1.7/includes/SpryDOMUtils.js" type="text/javascript"></script>
    <script src="file:///MacProG5-Docs/Spry-UI-1.7/includes/SpryDOMEffects.js" type="text/javascript"></script>
    <script src="file:///MacProG5-Docs/Spry-UI-1.7/includes/SpryWidget.js" type="text/javascript"></script>
    <script src="file:///MacProG5-Docs/Spry-UI-1.7/includes/SpryMenu.js" type="text/javascript"></script>
    <script src="file:///MacProG5-Docs/Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarKeyNavigationPlugin.js" type="text/javascript"></script>
    <script src="file:///MacProG5-Docs/Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarIEWorkaroundsPlugin.js" type="text/javascript"></script>
    <link href="file:///MacProG5-Docs/Spry-UI-1.7/css/Menu/basic/SpryMenuBasic.css" rel="stylesheet" type="text/css" />
    Each of the above points to a file on your local system and cannot be found by the remote server.
    Replace the red coloured parts with http://www.twhsbands.org/ will remedy the situation.
    You also have some remnants of the other SpryMenuBar that should be removed from your markup.
    Gramps
    Wel, so much for the red coloured parts, they did not show up.
    The red coloured parts read file:///MacProG5-Docs/

  • Trayer does not Adjust correctly when Switching to External Monitor

    Hello
    I use a laptop with xmonad and xmobar and trayer. When i connect my external monitor via VGA, i set it to primary. My xmobar moves perfectly to the top of my external monitor, with a width of 90% of the screen, as specified in my xmobarrc. However, trayer acts differently. It does move to my external monitor, however, its position overlaps with xmobar, and does not move correctly to the remaining 10% of the screen left by xmobar which i would like trayer to occupy.
    How can i make trayer move correctly?
    Thank you!
    Last edited by fawkes5 (2013-01-09 19:10:51)

    Hello again. If i start my external monitor when i startx (i.e through .xinitrc) then it sets correctly. So its just the dyanmic changing of resolution that trayer has trouble adjusting with.
    Last edited by fawkes5 (2013-01-11 00:35:28)

  • Report does not display correctly when exported to adobe

    Post Author: mgisonda
    CA Forum: Crystal Reports
    Hopefully someone can help me. I am currently running Crystal Reports profession version 10. I have applied service pack 1 and recently service pack 6. I am having a problem with the display of a report within adobe. My report is a bit complex. It is a 8.5x11 one page landscape report. It is set up in a grid format with multiple lines and boxes drawn on it. Here is the report information: Report Definition----
    Number of Database Fields:   144     Number of On-Demand Formulas:   40     UFLs in use:   None     Page N of M Used:   No     File Format Schema:   10.2.0    I created the report using CR developer. I use the report within a web project. The user requests the report and it returns to the user, an adobe file of the report. However, this is where I am having trouble. On my local development machine, the report displays fine. In CR developer, the report displays fine. When I export the report to Adobe from the CR Developer, it exports fine. BUT when I run the report from my web site, the adobe file that is returned is broken up over 42 pages. What seems to be actually happening is the return adobe file seems to think that the page size is 2in X 4in.. Where it got that, I don't know.The server running IIS is a windows server 2003. It has adobe 8.0 reader on it. I also have Crystal 10 Server Distribution loaded on it. And I have loaded CR10 Service pack 6 on that as well. Below is the web code that is used to display the report:Imports CrystalDecisions.Shared'Imports CrystalDecisions.CrystalReportsImports CrystalDecisions.CrystalReports.EngineImports CrystalDecisions.CrystalReports.Engine.ReportClassPublic Class PrintInspectionLayout    Inherits System.Web.UI.Page   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        Dim mNotInSpringDesign As String        Dim mPartType As String        mNotInSpringDesign = Request.QueryString("NotInSpringDesign")        If mNotInSpringDesign = "TRUE" Then            mStockCode = Request.QueryString("StockCode")            lblNotInSpringDesign.Text = "Stock Code #: " & mStockCode & " does not exist in Spring Design."            lblNotInSpringDesign.Visible = True            Response.Write("<br><br><br><br><br><font color='blue'><center><a href='SpringDesignWildCardSearch.aspx'>Go To Search Page</a></center></font>")        Else            mStockCode = Request.QueryString("StockCode")            Dim pList As ParameterValues = New ParameterValues            Dim paramName, paramValue As String            Dim pV As ParameterDiscreteValue = New ParameterDiscreteValue            Dim Report As ReportDocument= New ReportDocument            Dim expOpts As ExportOptions = New ExportOptions            Dim pdfRtfWordFormatOpts As PdfRtfWordFormatOptions = expOpts.CreatePdfRtfWordFormatOptions            Dim expFormatOpts As ExportFormatOptions = expOpts.ExportFormatOptions            expOpts.ExportFormatType = ExportFormatType.PortableDocFormat            mPartType = Request.QueryString("PartType")            'SELECT THE INSPECTION LAYOUT TYPE TO PRINT            Select Case mPartType                Case Is = "C"                    Report.Load(MapPath("./Reports/CompressionLayout.rpt"))                    'Report.Load(MapPath("./Reports/PCAR.rpt"))                Case Is = "E"                    Report.Load(MapPath("./Reports/ExtensionLayout.rpt"))                Case Is = "T"                    Report.Load(MapPath("./Reports/TorsionLayout.rpt"))                Case Is = "W"                    Report.Load(MapPath("./Reports/WasherLayout.rpt"))                Case Is = "F"                    Report.Load(MapPath("./Reports/FreeFormLayout.rpt"))                Case Else            End Select            pV.Value = mStockCode            pList.Add(pV)            Report.DataDefinition.ParameterFields("StockCode").ApplyCurrentValues(pList)            Response.ClearContent()            Response.ClearHeaders()            Response.ContentType = "Application/pdf"            Report.ExportToHttpResponse(expOpts, Response, False, "")            Report.Close()        End If    End Sub    Any ideas as to the solution? Why is it not displaying correctly? I have spent two days researching every FAQ  to try to find an answer, but to no avail. Please any help would be greatly appreciated. ThanksMike   

    Hi Paul
    You're more likely to get an answer to this if you post in the UNIX forum.
    By the looks of it, you may have a problem with your fonts.

  • Photoshop brush does not represent correctly when recorded with Adobe Captivate 7 How do I Fix this?

    Hello I have only just recently purchased adobe captivate 7.
    I am currently recording some footage in Photoshop and when ever I change the photoshop's brush size it does not correctly record it in Captivate but rather a giant pixelated version of it. or the brush does not match the size of the brush it is painting.
    It looks like something like this, http://imgur.com/a/Ko6Wg
    I was wondering if it is possible to record the cursor as it displays on my screen.
    below you can clearly see it is recording the brush size at the wrong size to what is been drawn. its kinda random in how it does it.
    Thanks ahead for anyone who has a soultion.

    Hi! I have the same problem and I was wondering if you ever figured how to fix it.

  • Application does not load correctly when deploying to standalone server

    All,
    I have created simple application implementing fusion theme. Applicaiton works fine when I run on integrated server but when deployed on standalone server it does not load any images or the theme itself. afrloop keep incrementing in status bar and ends up with java script error while later.
    I deployed another test application on standalone server and that works fine i.e. theme gets loaded correctly. Also, how should I include images on the page? I have a images folder in web content folder but they dont get loaded.
    Any help will be appreciated.
    Thanks,
    Dipal

    LabVIEW now uses the Microsoft installer. It's possible that you need to upgrade the version that's on the Win2K box. I think the latest service packs from Microsoft include it.

  • Audio does not behave correctly when Bluetooth headset disconnects

    When a Bluetooth audio receiver disconnects, Windows reverts to another active audio connection.  However, the programs that were previously using the Bluetooth connection do not transfer to the new audio connection and reactivating the Bluetooth connection
    does not get the audio from those programs back.  
    The only way to make them work again is to close the program and reopen it.  As a gamer - this is particularly a problem when batteries die.  Usually I would just swap the batteries in 10 seconds and turn the headphones back on, however it is not
    possible due to this issue.  Exiting the game would ruin my team's experience as 5+ minutes is approximately 10% of the game's average total time.

    Hi,
    There are 3 reasons I can think out:
    1. Bluetooth driver was not released when it is disconnected suddenly, this can be caused by Bluetooth software.
    2. Audio driver can be corrupted.
    3. There is the problem on the program itself.
    I recommend you do following test:
    Open Windows media player to play music with Bluetooth headset, and then disconnect Bluetooth headset and see if the headphones can work fine with media player.
    If it works fine, the issue is on the program you run with problem. Contacting the program provider would be more helpful.
    Otherwise, it's related to Bluetooth driver or software, please try to update them from manufacturer's website to see what's going on.
    Also, please check if there is any event related to this issue in Event viewer.
    Kate Li
    TechNet Community Support

  • Read Status does not apply correctly when working out of a shared mailbox.

    since updating to the Exchange 2010 SP3 RU4, users have been experiencing the same issues when working out of shared mailboxes. when user 1 opens an email or manually marks the email as read the status does not change from their perspective, the email remains
    unread. however, the other users viewing the shared mailbox immediately see the status change to read. User 1 has to re-sort his email from catagory to received or from ect. As soon as the emails are resorted the status changes. alternatively, if User 1 views
    another folder and returns back. the email is marked as read.
    This problem happens with Outlook 2007 and 2010
    This happens after re-creating the profile
    opening outlook with the switches /cleanprofile /cleanviews seems to solve the problem for an hour or so.
    I have run mailbox repairs on the server for the mailboxes in question.
    changing the behaviour in tools>options>reading pane> has no effect.

    Hi Brenn,
    To narrow down the issue, we need more investigation:
    1.Does the issue occurs only in Category view? Please check if user 1 set the view to Date and email read status update.
    2.Does the issue occurs to user1's own mailbox with the same setting as shared mailbox?
    3.If the shared mailbox is in cached mode, please check Account Settings > Change > More Settings... > Adwanced > Use Cached Exchange mode > check Download shared folders.
    4.Please switch to online mode for shared mailbox and test the issue.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Programme does not work correctly when built as an application

    My programme operates correctly when in development, but when built into an application it fails to function with regard to closing and opening front panels. I am using 'open VI referance' and 'property node virtual instrument Front panel open' to close and open front panel, it is this area that seems to fail.
    Do I have to do anything special with VI's that contain Server Functions?
    Any help would be appreciated. I am using LABview 5.0 with its Application Builder.
    Many Thanks

    Hi Dennis,
    It is very difficult to understand the problem here.
    1. Could you please explain what you mean when you say "it fails to function with regard to closing and opening front panels" ?
    2. It may also help if you can attach your program so that I can take a look at it.
    3. What is the program intended to do?? I mean, is it some sort of serial application etc.??
    I hope to solve your problem soon.
    Sincerely,
    Sastry V
    Applications Engineer

  • Name does not override correctly when creating a Division from template

    I am still having a problem when creating Divisions with the WebServices API.
    Namely, when I create a Division based on a Template (in order to have a given default thumbnail image and description, etc) the Name parameter (the "title" of the Division, which appears next to its icon on the main site page inside the top level Section boxes) is never set correctly. The Name I specify for the Division never overrides the default.
    In my example, I try to create a Division with name "Food Science and Human Nutrition." It is based on a Division template with handle 1911155332. The Name of that Division template is "Robot Division" and the ShortName is "RobotDivision".
    I am sending the following XML via Web Services:
    <ITunesUDocument>
    <Version>1.1.3</Version>
    <AddDivision>
    <ParentHandle>1945525657</ParentHandle>
    <ParentPath/>
    <TemplateHandle>1911155332</TemplateHandle>
    <Division>
    <Name>Food Science and Human Nutrition</Name>
    <ShortName>FSHN</ShortName>
    <Identifier>RobotCourses:FSHN</Identifier>
    <Permission>
    <Credential>Authenticated@urn:mace:itunesu.com:sites:illinois.edu</Credential>
    <Access>No Access</Access>
    </Permission>
    <Permission>
    <Credential>Student@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:FSHN</C redential>
    <Access>Download</Access>
    </Permission>
    </Division>
    </AddDivision>
    </ITunesUDocument>
    The Division is created and no errors come back. However, when I look at the site, the Name of the newly created Division is "Robot Courses" (not "Food Science and Human Nutrition" as I want). The ShortName IS correctly set to "FSHN" as I specified in the XML.
    Incidentally this was part of creating a Course "FSHN 101," the Course is also based on a Course template, but it creates with the Name and ShortName as I desire and there are no other problems - I can log into the Division and Course as expected.
    *QUESTION #1: Is anyone else out there ever having this problem?*
    *QUESTION #2: Is there anything obviously wrong in my XML?*
    I have tried this multiple times, always with the same result. Creating Divisions not based on a template works (but for various reasons we need to be able to use templates). I have been unable to edit the Name after the fact with MergeDivision either.
    Our campus Apple contact sent in a ticket about this, but the response from Apple was to post here in the forum, which is monitored. I am unsure if I should post questions of this sort here in the Administrators Forum or in the general forum, for this one I will try both.
    Thank you very much for any assistance.

    I am still having a problem when creating Divisions with the WebServices API.
    Namely, when I create a Division based on a Template (in order to have a given default thumbnail image and description, etc) the Name parameter (the "title" of the Division, which appears next to its icon on the main site page inside the top level Section boxes) is never set correctly. The Name I specify for the Division never overrides the default.
    In my example, I try to create a Division with name "Food Science and Human Nutrition." It is based on a Division template with handle 1911155332. The Name of that Division template is "Robot Division" and the ShortName is "RobotDivision".
    I am sending the following XML via Web Services:
    <ITunesUDocument>
    <Version>1.1.3</Version>
    <AddDivision>
    <ParentHandle>1945525657</ParentHandle>
    <ParentPath/>
    <TemplateHandle>1911155332</TemplateHandle>
    <Division>
    <Name>Food Science and Human Nutrition</Name>
    <ShortName>FSHN</ShortName>
    <Identifier>RobotCourses:FSHN</Identifier>
    <Permission>
    <Credential>Authenticated@urn:mace:itunesu.com:sites:illinois.edu</Credential>
    <Access>No Access</Access>
    </Permission>
    <Permission>
    <Credential>Student@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:FSHN</C redential>
    <Access>Download</Access>
    </Permission>
    </Division>
    </AddDivision>
    </ITunesUDocument>
    The Division is created and no errors come back. However, when I look at the site, the Name of the newly created Division is "Robot Courses" (not "Food Science and Human Nutrition" as I want). The ShortName IS correctly set to "FSHN" as I specified in the XML.
    Incidentally this was part of creating a Course "FSHN 101," the Course is also based on a Course template, but it creates with the Name and ShortName as I desire and there are no other problems - I can log into the Division and Course as expected.
    *QUESTION #1: Is anyone else out there ever having this problem?*
    *QUESTION #2: Is there anything obviously wrong in my XML?*
    I have tried this multiple times, always with the same result. Creating Divisions not based on a template works (but for various reasons we need to be able to use templates). I have been unable to edit the Name after the fact with MergeDivision either.
    Our campus Apple contact sent in a ticket about this, but the response from Apple was to post here in the forum, which is monitored. I am unsure if I should post questions of this sort here in the Administrators Forum or in the general forum, for this one I will try both.
    Thank you very much for any assistance.

  • Desktop Image does not display correctly when centered

    Have been doing a fair amount of Macro photography in high resolution lately. I often take the best close-up images and put them on my second monitor which is a Cinema Display. As the photos I take are 20MP when I select the images and center them, I *am* looking to in effect 'zoom in' and have the image displayed large.
    This works just dandy in Snow Leopard, apparently not so well - if at all - in Mavericks.
    What is the limiting issue here that an image no longer displays under the 'Centered' setting if that puts the edges of the frame beyond the display's edges? This is what I am talking about. You can see from the first three grabs, the desktop photo changes with each setting but stops in it's tracks with the last.
    http://home.comcast.net/~foodandart/MacForums/01-FitToScreen.jpg
    http://home.comcast.net/~foodandart/MacForums/02-StretchToFitScreen.jpg
    http://home.comcast.net/~foodandart/MacForums/03-FullScreen.jpg
    http://home.comcast.net/~foodandart/MacForums/04-Center.jpg
    That last photo would be stunning on my desktop if it was actually displaying as it shows in the Desktop Preference control panel.
    Any ideas?
    Deb.

    Hi Paul
    You're more likely to get an answer to this if you post in the UNIX forum.
    By the looks of it, you may have a problem with your fonts.

  • Search does not work correctly when including user name field

    I'm attempting to search for the word authenticator in my previous posts. I'm typing authenticator in the search box, my user ID (mthompson) in the username field, and selecting the appropriate datd range. There are no results found.
    That is wrong. When I click on the 'Your Control Panel' link, I very clearly see my previous posts containing that term.
    Why doesn't this work?

    The search functionality on these forums doesn't allow for a username to be entered, but it does allow for a User ID. this is the ID associated with your user when you hover over a link to your own user.
    In your case it's: 476329

  • Firefox does not function correctly when validating payments with HSBC bank

    When HSBC bank security is invoked by a website within an inline page the confirmed page is presented within the inline subpage in such a way that one cannot continue with the transaction confirmation, consequently the payment verification fails. Google chrome, safari and explorer do not suffer from this problem. It makes using my favourite browser impossible whenever I need to security verify any payment on a number of websites.

    That problem can be caused by the Yahoo! Toolbar or the Babylon extension that extents too much downwards and covers the top part of the browser window and thus makes links and buttons in that part of the screen not clickable.
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode

  • My iPad does not have sound when on the Internet, including YouTube, but does have sound with iTunes and other apps.  How can I correct this?

    My iPad does not have sound when on the Internet, including YouTube, but does have sound with iTunes and other apps.  How can I correct this?

    If you are sure that you have sound in other apps - and if you can still hear keyboard clicks and get notifications, then system sounds are not muted. Try this and see if it works.
    Close all apps completely and reboot the iPad.
    Go to the home screen first by tapping the home button. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

Maybe you are looking for