Macro expansion in the compiler

Is their any C++ compiler option for Solaris Studio which will show me each step in the expansion of a macro when I compile a program ?
I know about the compiler option which gives me the source after preprocessing. But that just shows the source from any macro after macro expansion has completely occurred. I need to see each step of the expansion of a macro as the preprocessor is expanding it.
Both gcc and clang have such a macro expansion compiler option so I am hoping that Solaris Studio C++ also has one.

Clang automatically shows step-by-step macro expansion whenever it generates a preprocessor error leading to the error.
With gcc the option -ftrack-macro-expansion=1 shows macro expansion for any macros it encounters when compiling. Clang may well also be supporting this gcc option also as it tries to be compatible with gcc as much as possible.
I will try -xdumpmacros but unless it shows step-by-step the expansion of a macro it will not be what I want. Perhaps there is an Oracle C++ #pragma which will show step-by-step macro expansion for any particular macro ?
I have been involved in the Boost preprocessor library as a Boost developer and have my own macro library called VMD, accepted into Boost, which I am trying to test with Oracle C++. If a macro in my library is not handled correctly by Oracle C++ the best way to debug the situation is if I can see how Oracle C++ is expanding my macro step-by-step. Since some other compilers can do this I was hoping Oracle C++ had a similar compiler option.
Boost have has a tool called Wave which shows a wonderful step-by-step macro expansion the way it should occur for a C++ standard preprocessor. It has been an invaluable tool during my development of my macro programming library. But any given compiler might not be expanding the macro correctly and unless I can figure out what a compiler might be doing if the macro expansion is not creating the correct output, it is very difficulty debugging a macro expansion problem unless the particular compiler can show a step-by-step expansion of a macro.

Similar Messages

  • Problem with macro expansion removing ? characters from macros

    Hi,
    When compiling the following code (CC ex.cpp), we always receive the error line 28: Error: Unexpected ":" found.
    ex.cpp
    #include <stdio.h>
    #include <stdarg.h>
    #include <string.h>
    #define ONE 1
    #define MCheck(n) (n == ONE ? "One" : "???")
    #define F1(buff, size, ...) func(buff, size, __VA_ARGS__)
    #define F(...) F1(acBuff, sizeof(acBuff), __VA_ARGS__)
    void func(char* buff, size_t len, const char* fmt, ...) {
        va_list args;
        va_start(args, fmt);
        size_t nWrote = vsnprintf(buff, len, fmt, args);
        va_end(args);
    int main(void) {
        char acBuff[10];
        // Parsed OK
        F1(acBuff, sizeof(acBuff), "%s\n", MCheck(1));
        printf("%s", acBuff);
        // Causes error
        F("%s\n", MCheck(1));
        printf("%s", acBuff);
        return 0;
    }This appears to be because the pre-processed code (found using CC -E ex.cpp) has removed the '?' characters from the parsed macro 'F' expansion as shown:
    (Code inserted from headers)
    #13 "ex.cpp"
    void func ( char * buff , size_t len , const char * fmt , ... ) {
    va_list args ;
    ( void ) ( args = ( __va_list ) & __builtin_va_alist ) ;
    size_t nWrote = vsnprintf ( buff , len , fmt , args ) ;
    ( void ) 0 ;
    int main ( void ) {
    char acBuff [ 10 ] ;
    func ( acBuff , sizeof ( acBuff ) , "%s\n" , ( 1 == 1 ? "One" : "???" ) ) ;
    printf ( "%s" , acBuff ) ;
    func ( acBuff , sizeof ( acBuff ) , "%s\n" , ( 1 == 1 "One" : "???" ) ) ;
    printf ( "%s" , acBuff ) ;
    return 0 ;
    }Is this an error with the compiler, or is there some flag we need to set to ensure the macros are expanded to the correct level?

    Bwadly wrote:
    Hi Maxim,
    Thanks for the feedback.
    We are using Solaris 8, so I'm guessing we should use Sun Studio 11? Correct, the latest release that supports Solaris 8 is Sun Studio 11. Be sure to patch both Solaris and Sun Studio once you install it.
    BTW, I was able to reproduce the problem using Studio 9 compiler (CC 5.6). Apparently, it got fixed in later versions of compiler - patched version of CC 5.6 does not have it.
    Edited by: MaximKartashev on 15.08.2008 12:55

  • How can I get to the compiler arguments in Flash Builder 4.6?

    Howdy!
    So far I've been unable to locate any information that could help me with my task. The ultimate goal is to build my project's SWF with mxmlc. I was not able to figure it out and thought I'd install Flash Builder in the hopes of being able to get to the compiler arguments. No luck.
    First, I'm not the lead on the building of the SWF. This is done by another person via the Eclipse plugin; her hard drive crashed last night too. In fact I'm not a Flash developer. I'm coming at this from a Build Infrastructure perspective.
    Any help would be greatly appreciated.
    Cheers,
    Mel Riffe

    Mel Riffe,
    Here's a Help topic about compiler options in Flash Builder: http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb524b8220812e5611f28f-7fe7. html
    For information on using mxmlc, the application compiler, to compile SWF files from your ActionScript and MXML source files, you can see: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fcc.html
    Hope this helps,
    Mallika Yelandur
    Flash Builder Community Help & Learning
    Adobe Systems Incorporated

  • How can I keep Itunes from wanting to put my music cd in the compilations folder.  Even a 2 disc set sometimes itunes will place one cd in a folder of the name of the band and the other disc in the compilations folder under the name of the cd

    Two issues.  The first one is that when I upload some music cd's into my itunes library, itunes wants to place the songs in a compilations folder.  Sometimes this occurs even with a 2 or 3 cd set.  One CD will be filed under the artists name and the disc 2 may be filed in the compilations folder and listed by the name of the cd and not the artist.
    2nd issue is that sometimes cd's are similiar, but with different artists such as 20th century Hits of Neil Young.  The CD is filed in the compilations folder.  Than I upload the 20th century Hits of Tanya Tucker and the songs go into the same folder with Neil Young.  The don't even mix as one is county and the other is rock.
    I have moved these CD's out of the compilations folder and moved them in with the other cd's by the same artist, but Itunes keeps moving them back into the compilations folder.
    Is there a fix

    Generally setting a common Album title and Album Artist will fix things.
    For compilations that aren't, select all tracks, Get Info, and on the option tab set Part of a Compilation to No. If it already says No tick the box alongside, then click OK.
    For deeper problems see Grouping tracks into albums.
    tt2

  • How can I read ALL the compilation errors in a DOS window?

    On compilation using a DOS window, if the number of errors exceeds the window size, some of the errors disappear off the top of the window and I cannot read them.
    Is there an effective solution to somehow use scrolling of the DOS window or transfer the compilation errors to a file?

    Hey buddy,
    When I first started programming with Java, I wondered the same thing. I have the very best solution for you. This one is waaay easy!!!!
    There is a text editor which will not only color code your text for you, but you can easily configure it to give you the compiler /DOS output for Java. Just go to this website and download the program. Enjoy!
    http://www.textpad.com/

  • How do I add a jar file into the build path of the compiler?

    Hey,
    I'm trying to import a jar file into the build path of the compilation process, but it does not find the packages or the classes that are in it.
    I think I don't add it right...
              ArrayList<String> options=new ArrayList<String>();
              options.add("-d");
              options.add(targetDirectory);
              options.add("-classpath");
              for(String str:includeDirectory)
                   options.add(str);
              if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call());
                    ....and I've tried this way:
         public void setTargetDirectory(String targetDirectory) {
              this.targetDirectory = "-d " + targetDirectory;
         private void compile(Iterable<? extends JavaFileObject> compilationUnits) throws Exception {
              ArrayList<String> options = new ArrayList<String>();
              options.add(targetDirectory);
              String classPath="-cp ";// tried this also with "-classpath"
              for (String str : includeDirectory)
                   classPath+=str+":";
              options.add(classPath);
         if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call())
              // throw new Exception("Compilation Error");
         }Thanks in advance,
    Adam.
    Edited by: Adam-Z. on Feb 24, 2010 5:41 AM
    Edited by: Adam-Z. on Feb 24, 2010 5:42 AM

    Thank you for your reply,
    Q: Are there .class files in that directory in that jar file? (the compiler doesn't ( can't )) look for directories, it can just look for specific files , and scan to get a list of all files matching certain criteria. So if there are no class files, it will say the package doesn't exist, even if there is a directory, possibly containing other files.yes there are class files in the jar, the tree structure:
    j2MeDataChunkGenerator_Plugin\(lots of class files)
    META-INF\manifest.mf
    and thats it.
    , your code will only work on windows because other platforms use a different path separator. You should use java.io.File.pathSeparator not explicit ';" when building your classpath. (this is unrelated to your problem, but you should correct it)will do, thanks.
    Q: Is that error in your post formatted by your own diagnostics? (we could possibly help you better if we didn't have to guess!!)I would not post my own error code, this text is generated by the compiler diagnostic.
    {code}
         System.err.println(" Error details: " + diagnostic.getMessage(null));
    {code}
    Q: Is line 3 of ImageCroper_Editor.java (sic) an import statement? (we could possibly help you better if we didn't have to guess!!)it is an import error... didn't the error message stated that it is an import problem? wired, I'm sure before it did. anyway it is an import error.
    Also you don't show us what the variable includeDirectory is in terms of type, and contents, that might be helpful. (we could possibly help you better if we didn't have to guess!!)It has only one String object: "D:\%Important Documents\WorkSpaces\PacMan\ApplicationManager\Plug-in\Data Chunk Designer.jar"
    the last file on the classpath list.
    Q: Have you proven this? that i did post, in this long line of text.
    Q: Is the compiler finding other classes (in other packages) in that same jar file?No. all the class files are in the jar, they all have entries that start with "j2MeDataChunkGenerator_Plugin\*.class", and since I get 47 errors I guess it does not load any other class.
    thank you for you comments, the problem with having these errors, is that I can't even get a piece of information where this error is coming from, only that it is an import loading error package not found, what does that mean? that the jar was not loaded in compilation(no error about this), that the jar is corrupted(no error about this), that the path is incorrect(it is correct I made sure), that there is no such package in the jar(There is), that the compiler does not load the package(does it even do that?), really I can't even guess why this happens, I've been at this on and of all day today, really annoying.
    Thanks,
    Adam.

  • Error while executing the compilation process

    Hi,
    ISA Framework: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation process:  javac: invalid flag: "/usr/sap/CJP/J06/j2ee/cluster/server2/apps/sap.com/crm~isauseradm/servlet_jsp/isauseradm/work/jsp_login XXXXXXXXXXX.java" Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -d <directory> Specify where to place generated class files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -help Print a synopsis of standard options ].
    We get this message periodically then we login to isauseradm-application or shopadmin-application.
    How we can solve this issue? Why it's appears in system?
    /nwa shows this error:
    Process after commit failed - may be hanging internal locks mut be removed manually.
    Where I can see hanging internal locks ?
    Denis

    to add some information,
    in runtime workbench, component monitoring, performance monitoring and all other thing except message monitoring is OK.

  • Help needed in understanding the compiled format of actionscripts

    Hi all,
    I need to inject an actionscript to an existing .SWF file. So
    can anyone help me out in explaining the process involved in the
    compilation of the action script into binary form which has to be
    injected into the existing SWF file. I need to do this
    programmatically using Java. So pls dont suggest me any Third party
    softwares which does that.
    Please help me out..
    Thanks in advance.
    Prabakaran Srinivasan.

    Hi all,
    I need to inject an actionscript to an existing .SWF file. So
    can anyone help me out in explaining the process involved in the
    compilation of the action script into binary form which has to be
    injected into the existing SWF file. I need to do this
    programmatically using Java. So pls dont suggest me any Third party
    softwares which does that.
    Please help me out..
    Thanks in advance.
    Prabakaran Srinivasan.

  • Subfolders are not seen by the compiler

    In an Actionscript Flash Builder 4 project, I have my main folder set to "src".  All of the files within "src" compile.  But I have several subfolders, each with several .as files, for example:
    src
      main.as
        module1
          mod1_1.as
          mod1_2.as
        module2
          mod2_1.as
          mod2_2.as
    The subfolders are seen as packages in Package Explorer.  Yet none of the files are seen by the compiler, and none of the files within compile.  I can make obvious errors in the source files in these packages, but error messages are never generated.  I thought .as files within subfolders would automatically be processed by the compiler.  Is there a setting I'm missing?
    Thanks,
    Brian

    Flex harUI wrote:
    The compiler starts at the application and compiles it and anything it
    references.  Sometimes I'll just make the module the "default application"
    until it compiles.
    Yes, I figured out that I had to reference all the sub packages with "import" statements.  Then the compiler sees them.  This wasn't the case when the project was in Flash CS4. Everything compiled automatically.
    I'm now having a problem with embedding fonts.  They worked fine in Flash.  I'll try a couple more things then may ask another question.
    Thanks.
    --Brian

  • TS1468 Where is the compilation option in version 11?

    I have a single album what was split into 5 sections because of variations on artist name. Past support articles suggested using the Compilation option when selecting the multiple split portions. Where is that option in version 11 of iTunes? I do no see this feature.

    Compilation can be found in the Get Info dialog. Generally all you need to do to link things is fill in an appropriate Album Artist.  For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • Can't change the 'compilation status' for multiple items in iTunes 8.

    Hi there,
    I've got an issue regarding the disappearance of the compilation 'tick box' when changing multiple items. Its there when you click on 'get info' for the individual track but its no longer there (in iTunes 8) when I want to change the compilation 'status' for multiple tracks at a time.
    In iTunes 7 I selected all the tracks and changed their compilation status by accident, but now, in iTunes 8 I can't change this without going through my library, track by track!.
    Please help.
    Thanks,
    Fred

    Multiple Get info now has tabs - look on the options tab.

  • "LabVIEW FPGA: The compilation failed due to timing violations, but there is no path information because the timing violations are not of type PERIOD

    The compilation of my labview fpga vi fails with the error message "LabVIEW FPGA:  The compilation failed due to timing violations, but there is no path information because the timing violations are not of type PERIOD".
    In the 'final timing (place and route)' report, the requested frequencies are all below the maximum frequencies and the compilation error message is only displayed at the very end on the 'summary' page.
    I tried to optimize my labview fpga vi with pipelining, but had no success.
    Can anybody offer some advice on how to debug fpga code with this error? Is this really a timing error or something else?
    Software:
    Labview 2011, fpga 2011, xilinx tools 12.4 sp1
    Hardware:
    NI PXIe-1071 Chassis
    NI PXIe-8108 Embedded controller
    NI PXIe-7965R FPGA FlexRIO FPGA module
    NI 5761 250 MS/s 14 bit Analog input digitizer
    The Xilinx log of the compilation run is attached.
    Also, this issue was already discussed in this thread ~6 months ago, but no satisfying answer was offered so far...
    Thanks,
    Fabrizio
    Attachments:
    xilinxlogc.txt ‏2313 KB

    Hi Kyle,
    the problem is: I have one computer which compiles the VI successfully and a second one which shows that error. Both use the same software setup (LV2011SP1+RT+FPGA from DS2012-01). Both use the same project file - atleast SVN shows no difference.
    - You can have one FPGA VI where one computer is compiling successful and a second one complains. (Btw. I have a SRQ running in Germany on this topic.)
    - More problems: After successful compiling on first computer and transferring all to second computer (using SVN, including the full project folder with all files like bitfiles, lvproj, and everything) the second computer is unable to start the RT executable due to error "FPGA VI needs to recompile". Solution so far: Call the FPGA-OpenReference with the bitfile instead of the VI (as I used to do until now)...
    - More problems: After modifying the FPGA-OpenReference to use the bitfile (on the 2nd computer) and transferring all the files back to the 1st computer (using SVN as before, including the whole project) the 1st computer complains: FPGA-OpenReference is creating a different reference than is used in the VI. So what happens here? On one computer my VI is ok, the reference is typed correctly. Transferring all the files to a different computer the VI isn't ok anymore due to changes of the reference??? You know: all files are the same: lvproj, FPGA bitfile didn't change, cRIO reference didn't change...
    All those problems didn't occur on my RT-FPGA projects in LV2010SP1. I'm not pleased...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • An error occurred during the compilation of the requested file, or one of its dependencies.

    An error occurred during the compilation of the requested file, or one of its dependencies. The type or namespace name 'Directory Services' does not exist in the namespace 'System' (are you missing an assembly reference?) 

    Hello,
    What you are trying to achieve and where you are getting this error?
    If you facing issue with namespace then refer this link:
    http://stackoverflow.com/questions/265096/system-directoryservices-is-not-recognised-in-the-namespace-system
    http://stackoverflow.com/questions/10691001/the-type-or-namespace-name-directoryservices-does-not-exist-in-the-namespace
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Is it possible to make the compiler driver use a third-party pre-processor?

    In other compiler suites I've used in the past it's been possible to force the compiler driver to use a different pre-processor if it was needed.  Does Sun Studio offer similar functionality?
    Ultimately what I'm after is finding a way to force the compiler to do pre-processing and compilation in separate processes.
    -Brian

    What compiler(s) are you using --C, C++, or Fortran?
    What version of Studio are you using?
    The exact answer might depend on the compiler and version.
    But before looking at replacements for the compiler's own preprocessor, do you really want to run your own preprocessing program? If so, the the recognition of source code and the output format need to be compatible with the compiler.
    If you just want to separate preprocessing from the rest of the compilation, you can use the -P or -E options to get the preprocessor output, then compile that output. To maintain correspondence with the original source code files and lines, you would use the -E option. C example:
    % cc -E hello.c > newhello.c
    % cc newhello.c
    % ./a.out
    Hello
    For C++, templates can introduce problems when you expect the compiler to find template definitions automatically, as is the case with the standard library. You will  probably need to add the option -template=no%extdef to be able to compile template code. C++ example:
    % CC -E -template=no%extdef hello.cc > newhello.cc
    % CC -template=no%extdef  newhello.cc
    % a.out
    Hello world.
    Refer to the C++ Users Guilde chapters on template compilation models for for details.

  • [svn] 1625: Avoiding an NPE instead of blindly instantiating a new localization manager here when encoding the compilation result of a CSS file to a SWF to unblock QE .

    Revision: 1625
    Author: [email protected]
    Date: 2008-05-08 13:53:33 -0700 (Thu, 08 May 2008)
    Log Message:
    Avoiding an NPE instead of blindly instantiating a new localization manager here when encoding the compilation result of a CSS file to a SWF to unblock QE.
    Doc: No
    QE: Yes
    Bugs: SDK-15490 - Compiler gives nullpointer in encode of incremental compile if benchmark is set to true
    Reviewer: Paul
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15490
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java

    Hi, thank you for your replies, I found out few things about my servlet, and its portability
    and i have few questions, although i marked this topic as answered i guess its ok to post
    I am using javax.servlet.context.tempdir to store my files in that servletcontext temporary directory. But i dont know how to give hyperlink
    of the modified files to the user for them to download the modified files.
    What i am using to get the tempdir i will paste
    File baseurl = (File)this.getServletContext().getAttribute("javax.servlet.context.tempdir");
    System.out.println(baseurl);
    baseurl = new File(baseurl.getAbsolutePath()+File.separator+"temp"+File.separator+"files");
    baseurl.mkdirs();so i am storing my files in that temp/files folder and the servlet processes them and modifies them, then how to present them as
    links to the user for download ?
    and as the servlet is multithreaded by nature, if my servlet gets 2 different requests with same file names, i guess one of them will be overwritten
    And i want to create unique directory for each request made to the servlet , so file names dont clash.
    one another thing is that i want my servlet to be executed by my <form action> only, I dont want the user to simply type url and trigger the servlet
    Reply A.S.A.P. please..
    Thanks and regards,
    Mihir Pandya

Maybe you are looking for

  • Posting period on status "period closing" allows enter goods receipt

    Hi to all: My customer is having the problem that the posting periods that is on status "period closing" allows users to save goods receipt and goods issue that DON'T have the authorizations under: 1) General / Period status: Unlocked Except Sales 2)

  • IPhoto Books... no pix on page to old project

    Greetings - Have recently upgraded to iLife'11 and iPhoto 9.1.5. All pictures, events, albums, books, etc seem to be present. however previously made books show no photos placed on pages. Again, entire cache of pix for project remain on side to pick

  • Highest resolution?

    I'm just wondering what the highest resolution is that can be pulled from a mac mini? At the moment I'm using an AOC monitor which is running at 1280x1024 @ 75Hz, but let's say that I got one of the 20, 23 or 30 inch Cinema displays... would all of t

  • Login History of Users

    Hello Experts, I need a report having the login details of few users in SAP since 01/04/2010. The management wants to get the login days & login time as well as the last approved document date by the user. From which tables ,I'll get? Rgds Subrata

  • Form works using Adobe 7.0 Professional but not in 8.0 Professional

    I created a password protected form using Adobe 7.0 Professional (Windows XP) that pulls data from an oracle database. The form is used by several people and works great. The problem is the form does not work if in Adobe 8.0 Professional with the pas