Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Compiler Error on identifier "__builtin_addressof"

Options
saurav13
saurav13 Posts: 3

Hi,

I am trying to run a unit test using Parasoft 10.3 plugin for Eclipse Neon and stumbling upon a compiler error. The project compiles successfully when just building the project through Eclipse so there are no compile errors. But, when I try to run a unit test in this project then it fails to compile with a compiler error as follows:

...
[C++ test] [TestSuite_ClassA_cpp.cpp] "C:/compiler/.../arm/sysroot/usr/include/c++/x.x.x/bits/move.h, line 48: error:
identifier "__builtin_addressof" is undefined
{ return __builtin_addressof(__r); }
...

Since this compile error does not occur during a normal project build in Eclipse, it must be related to Parasoft build as it only occurs during a unit test build.

Please advice on how to resolve this.

Thanks,
-Saurav

Comments

  • Mirek
    Mirek Posts: 141 admin
    Options

    Hi,

    The error you are facing is an effect of source code instrumentation. The best way to diagnose it is by analyzing the preprocessed file, before instrumentation. Can you please preprocess the source file for which you see the error and report the problem to the support team together with the preprocessed file?

  • saurav13
    saurav13 Posts: 3
    Options

    How do I preprocess a file?
    Do I need to customize a unit test configuration to contain only the preprocess step and use that to create a preprocessed file?

  • Mirek
    Mirek Posts: 141 admin
    Options

    Please go to Parasoft Menu -> preferences -> Technical Support and enable "Preprocessed source files" and "Enable auto-creation of support archives". Note the path in "Archives location" field. Next run the unit testing configuration, upon failure C++test should create a tech support archive in the "Archives location". The archive should contain the preprocessed file, you can contact Parasoft support team and attach this archive or extracted preprocessed file only.

  • saurav13
    saurav13 Posts: 3
    Options

    I cannot provide the archive (or any other file from the working PC) because it is classified. What other information can I provide to help with this case?

  • Mirek
    Mirek Posts: 141 admin
    Options

    Can you share the information about compiler? What is the version number? Is this commercial or your own build of gcc? Also, is your target 32 or 64 bit?

  • Mirek
    Mirek Posts: 141 admin
    Options

    In addition to my previous comment, can you please provide information what is the compiler family selected in the Project Properties->Parasoft->C++test->Build Settings?