https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105390
Bug ID: 105390 Summary: [12 regression] sigfpe redeclared in mc-boot-ch/GSysExceptions.c Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: ro at gcc dot gnu.org Target Milestone: --- Target: *-*-solaris2.11 Building the devel/modula-2 branch on Solaris fails with /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c:89:25: error: 'sigaction sigfpe' redeclared as different kind of entity 89 | static struct sigaction sigfpe; | ^~~~~~ In file included from /var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-gcc/include-fixed/math.h:391, from /var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/bits/std_abs.h:40, from /var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/cstdlib:77, from /var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/stdlib.h:36, from /vol/gcc/src/hg/master/modula-2/gcc/system.h:265, from /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c:23: /usr/include/floatingpoint.h:64:28: note: previous declaration 'void (* sigfpe(sigfpe_code_type, sigfpe_handler_type))()' 64 | extern sigfpe_handler_type sigfpe __P((sigfpe_code_type, sigfpe_handler_type)); | ^~~~~~ In file included from /usr/include/sys/procset.h:17, from /usr/include/sys/wait.h:22, from /usr/include/stdlib.h:16, from /var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/cstdlib:75: /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c: In function 'void SysExceptions_InitExceptionHandlers(void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*), void (*)(void*))': /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c:203:10: error: request for member '_funcptr' in 'sigfpe', which is of non-class type 'void (*(sigfpe_code_type, sigfpe_handler_type))()' {aka 'void (*(int, void (*)()))()'} 203 | sigfpe.sa_sigaction = sigfpeDespatcher; | ^~~~~~~~~~~~ /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c:204:10: error: request for member 'sa_flags' in 'sigfpe', which is of non-class type 'void (*(sigfpe_code_type, sigfpe_handler_type))()' {aka 'void (*(int, void (*)()))()'} 204 | sigfpe.sa_flags = (SA_SIGINFO); | ^~~~~~~~ /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c:205:24: error: request for member 'sa_mask' in 'sigfpe', which is of non-class type 'void (*(sigfpe_code_type, sigfpe_handler_type))()' {aka 'void (*(int, void (*)()))()'} 205 | sigemptyset (&sigfpe.sa_mask); | ^~~~~~~ /vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot-ch/GSysExceptions.c:207:26: error: cannot convert 'void (* (*)(sigfpe_code_type, sigfpe_handler_type))()' {aka 'void (* (*)(int, void (*)()))()'} to 'const sigaction*' 207 | if (sigaction (SIGFPE, &sigfpe, &old) != 0) | ^~~~~~~ | | | void (* (*)(sigfpe_code_type, sigfpe_handler_type))() {aka void (* (*)(int, void (*)()))()} In file included from /vol/gcc/src/hg/master/modula-2/gcc/system.h:432: /usr/include/signal.h:46:27: note: initializing argument 2 of 'int sigaction(int, const sigaction*, sigaction*)' 46 | extern int sigaction(int, const struct sigaction *_RESTRICT_KYWD, | ^ The same issue exists in gm2-libs-ch/SysExceptions.c. I've worked around this by renaming sigfpe to sigfpe_.