I'm experimentally rebuilding rawhide with the not-yet-released GCC 15 to see if anything breaks, and to help write the porting guide. See https://fedoraproject.org/wiki/User:Dmalcolm/gcc-15 My test build with GCC 15 failed: https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed/build/8476046/ whereas my test build with GCC 14 succeeded: https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed.checker/build/8477596/ Looking at the failure logs e.g. https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-x86_64/08476046-R/builder-live.log.gz I see: sys-std.c:1189:1: warning: 'noreturn' attribute ignored [-Wattributes] 1189 | void Rstd_CleanUp(SA_TYPE saveact, int status, int runLast) | ^~~~ sys-std.c:1189:1: error: expected identifier or '(' before 'void' I'm not yet sure what's causing this; possibly due to the change of default to C23 ? Reproducible: Always
Looking at https://svn.r-project.org/R/trunk/src/unix/sys-std.c the context seems to be: /* R_CleanUp is invoked at the end of the session to give the user the option of saving their data. If ask == SA_SAVEASK the user should be asked if possible (and this option should not occur in non-interactive use). If ask = SA_SAVE or SA_NOSAVE the decision is known. If ask = SA_DEFAULT use the SaveAction set at startup. In all these cases run .Last() unless quitting is cancelled. If ask = SA_SUICIDE, no save, no .Last, possibly other things. */ attribute_hidden NORET void Rstd_CleanUp(SA_TYPE saveact, int status, int runLast) {
I'm guessing that "attribute_hidden" is defined in https://svn.r-project.org/R/trunk/src/include/Defn.h which has: #ifdef HAVE_VISIBILITY_ATTRIBUTE # define attribute_visible __attribute__ ((visibility ("default"))) # define attribute_hidden __attribute__ ((visibility ("hidden"))) #else # define attribute_visible # define attribute_hidden #endif but I wasn't able to find a definition of "NORET". Or maybe something else is going wrong.
Upstream is aware of this AFAICT (see e.g. https://github.com/search?q=repo%3Awch%2Fr-source%20gcc%2015&type=code). So they will likely solve this in the next release.
I think GCC in this spot only handles C23 attributes before GNU attributes, not the other way around, so NORET attribute_hidden void Rstd_CleanUp(SA_TYPE saveact, int status, int runLast) { would be ok but attribute_hidden NORET void Rstd_CleanUp(SA_TYPE saveact, int status, int runLast) { is not.
And isn't this a GCC issue? Anyway, upstream provided a patch for now. Closing here.
As clarified by C FE maintainer, it is intentional that way. __attribute__ is a GNU extension and its placement is generally more forgiving, while the C23 standard clearly specifies where in the grammar they can appear and what they appertain to in each of those cases.