Menu

cppcheck compilation fails in AIX due to missing functions

2025-09-18
3 days ago
  • Reshma V Kumar

    Reshma V Kumar - 2025-09-18

    Hi All,
    During the compilation of cppcheck in AIX using gcc compiler, I encountered the following errors:
    1.

     /home/buildusr/reshma/cppcheck/cli/processexecutor.cpp: In member function 'bool ProcessExecutor::checkLoadAverage(size_t)':
     /home/buildusr/reshma/cppcheck/cli/processexecutor.cpp:288:9: error: 'getloadavg' was not declared in this scope
       288 |     if (getloadavg(&sample, 1) != 1) {
           |         ^~~~~~~~~~
    

    2.

     /home/buildusr/reshma/cppcheck/test/signal/test-signalhandler.cpp:60:9: error: 'feenableexcept' was not declared in this scope; did you mean 'feraiseexcept'?
        60 |     if (feenableexcept(FE_ALL_EXCEPT) == -1)
           |         ^~~~~~~~~~~~~~
    

    3.

     /home/buildusr/reshma/cppcheck/test/signal/test-signalhandler.cpp: In function 'int main(int, const char* const*)':
     /home/buildusr/reshma/patch_contribution/cppcheck/test/signal/test-signalhandler.cpp:85:16: error: 'my_fpe' was not declared in this scope
        85 |         return my_fpe();
    

    4.
    g++: error: unrecognized command-line option '-rdynamic'

    In AIX, getloadavg, feenablexcept and my_fpe functions are not available. Also, -rdynamic option is not supported. Attempting to use these results in the above errors.
    Attached a patch that checks whether the platform is AIX before making use of these functions and -rdynamic flag. With these changes, I am able to successfully compile cppcheck in AIX.
    Please let me know your suggestions on these changes and if any further information is required.

     
  • CHR

    CHR - 2025-09-18

    Are you able to open a PR at https://github.com/danmar/cppcheck/pulls?

     
  • Reshma V Kumar

    Reshma V Kumar - 3 days ago
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.