Closed ShreyasKhandekar closed 11 months ago
In the C++ frontend we have e.g. __attribute__ ((format (printf, 3, 4)))
on a number of functions. I'm not sure if this is non-standard or non-portable or C++ only. But, I think getting the C compiler's format string checking helps a lot.
A quick docs search shows that it seems gcc
has had these attributes since 3.1 and the list of supported attributes has grown since.
https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes
I added one of those attributes relatively recently without any issues. So, we should just go ahead and add it. As long as we can build the runtime for CHPL_GPU={nvidia,amd}
, I don't think we need to worry about its portability, given that none of the instances in the runtime has any checks for being portable.
We probably haven't come across this so far, because we (at least me) still use the LLVM backend with the cpu-as-device mode.
Summary of Problem
Using
CHPL_GPU=cpu
with the gnu compiler gives us a few instances of the following warning:This warning is raised to an error when using
CHPL_DEVELOPER
causing a build failure.Steps to Reproduce
Build failure. No code needed. Just reproduce environment and
make
Configuration Information
chpl --version
:$CHPL_HOME/util/printchplenv --anonymize
:gcc --version
orclang --version
:Since there is only once place where this warning is raised, we could do what the error suggests. Another option would be to squash this particular error.