https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116181

            Bug ID: 116181
           Summary: -Wlto-type-mismatch warnings/errors during m2
                    bootstrap
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: arsen at gcc dot gnu.org
  Target Milestone: ---

Similar to PR114529.

With LTO bootstrap and -Werror=lto-type-mismatch, I see lots of the following:
```
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot/Gldtoa.h:60:20:
error: type of ‘ldtoa_strtold’ does not match original declaration
[-Werror=lto-type-mismatch]
   60 | EXTERN long double ldtoa_strtold (void * s, bool *error);
      |                    ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/Gldtoa.cc:46:1:
note: ‘ldtoa_strtold’ was previously declared here
   46 | ldtoa_strtold (const char *s, int *error)
      | ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/Gldtoa.cc:46:1:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot/Glibc.h:201:13:
error: ‘libc_perror’ violates the C++ One Definition Rule [-Werror=odr]
  201 | EXTERN void libc_perror (const char *string_, unsigned int
_string_high);
      |             ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/Glibc.c:164:1:
note: type mismatch in parameter 1
  164 | libc_perror (char *s)
      | ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/Glibc.c:164:1:
note: type ‘char’ should match type ‘const char’
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/Glibc.c:164:1:
note: ‘libc_perror’ was previously declared here
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot/GSelective.h:66:13:
error: type of ‘Selective_FdIsSet’ does not match original declaration
[-Werror=lto-type-mi
smatch]
   66 | EXTERN bool Selective_FdIsSet (int fd, Selective_SetOfFd s);
      |             ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSelective.c:149:1:
note: return value type mismatch
  149 | Selective_FdIsSet (int fd, fd_set *s)
      | ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSelective.c:149:1:
note: type ‘int’ should match type ‘bool’
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSelective.c:149:1:
note: ‘Selective_FdIsSet’ was previously declared here
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSelective.c:149:1:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot/GSysExceptions.h:57:13:
error: type of ‘SysExceptions_InitExceptionHandlers’ does not match original
declaratio
n [-Werror=lto-type-mismatch]
   57 | EXTERN void SysExceptions_InitExceptionHandlers
(SysExceptions_PROCEXCEPTION indexf, SysExceptions_PROCEXCEPTION range,
SysExceptions_PROCEXCEPTION casef, SysExceptions_PROCEXCEP
TION invalidloc, SysExceptions_PROCEXCEPTION function,
SysExceptions_PROCEXCEPTION wholevalue, SysExceptions_PROCEXCEPTION wholediv,
SysExceptions_PROCEXCEPTION realvalue, SysExceptions_
PROCEXCEPTION realdiv, SysExceptions_PROCEXCEPTION complexvalue,
SysExceptions_PROCEXCEPTION complexdiv, SysExceptions_PROCEXCEPTION protection,
SysExceptions_PROCEXCEPTION systemf, SysE
xceptions_PROCEXCEPTION coroutine, SysExceptions_PROCEXCEPTION exception);
      |             ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSysExceptions.c:162:1:
note: type mismatch in parameter 1
  162 | SysExceptions_InitExceptionHandlers (
      | ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSysExceptions.c:162:1:
note: ‘SysExceptions_InitExceptionHandlers’ was previously declared here
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/GSysExceptions.c:162:1:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot/Glibc.h:309:12:
error: ‘libc_snprintf’ violates the C++ One Definition Rule [-Werror=odr]
  309 | EXTERN int libc_snprintf (void * dest, size_t size, const char
*format_, unsigned int _format_high, ...);
      |            ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/m2/mc-boot-ch/Glibc.c:236:1:
note: ‘libc_snprintf’ was previously declared here
  236 | libc_snprintf (char *dest, size_t length, const char *_format, unsigned
int _format_high, ...)
```

Reply via email to