Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2457
Closed
Open
Created Feb 24, 2025 by Quinten Cabo@QuintenDeveloper

Clang build issues

I want to run the tests so I followed the instructions in the README and ran cmake with the -DFUNCTESTS=ON flag. I also installed the latest version of googletest. I then got the error

/usr/local/include/gtest/internal/gtest-port.h:273:2: fatal error: C++ versions less than C++17 are not supported.
273 | #error C++ versions less than C++17 are not supported.

Among other things I tried to fix this by trying to compile with clang instead of gcc. I did not manage to resolve this error and in the end I just edited the header file to remove this version check and that seems to work.

However, by now I had changed my cc and c++ symbolic links to clang using the update-alternatives command. This gave me new errors while trying to compile.

So far these errors are related to casting from an enum to an int:

sac2c/src/libsac2c/distmem/mark_prf_result.c:73:18: fatal error: implicit conversion changes signedness: 'prf' to 'int' [-Wsign-conversion]
   73 |         int op = PRF_PRF (rhs);
      |             ~~   ^~~~~~~~~~~~~
sac2c/build/src/libsac2c/node_basic.h:2572:68: note: expanded from macro 'PRF_PRF'
 2572 | #define PRF_PRF( n) (NBMacroMatchesType( n, N_prf)->attribs.N_prf->Prf)
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
1 error generated.
[ 58%] Building C object src/libsac2c/CMakeFiles/sac2cShared.dir/flatten/wldefaultpartition.c.o
make[2]: *** [src/libsac2c/CMakeFiles/sac2cShared.dir/build.make:2462: src/libsac2c/CMakeFiles/sac2cShared.dir/distmem/mark_prf_result.c.o] Fout 1
make[2]: *** Wachten op onvoltooide taken...
/home/qc/school/2024-2025/Master-Thesis/sac2c/src/libsac2c/flatten/flatten.c:388:40: fatal error: implicit conversion changes signedness: 'contextflag' to 'int' [-Wsign-conversion]
  388 |         INFO_FLAT_CONTEXT (arg_info) = old_context;

and

fatal error: implicit conversion changes signedness: 'file_type' to 'int' [-Wsign-conversion]
  364 |     INFO_FILETYPE (arg_info) = MODULE_FILETYPE (arg_node);
      |                              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~

and another one relating to the vis argument of STadd in symboltable.c which is an int cast from stvisibility_t.

I also get the warnings that get turned into errors that

cc: error: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Werror,-Wdeprecated-ofast]

There are also some errors where if you have no arguments to a function you have to put void. This is the first one.

/src/libsac/hwloc/cpubind.c:265:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
  265 | SAC_HWLOC_init ()
      |                ^
      |                 void
Edited Feb 24, 2025 by Quinten Cabo
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking