public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -Wint-conversion as errors seems doable for GCC 14
@ 2023-10-04 17:20 Florian Weimer
  2023-10-09  6:26 ` Sam James
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2023-10-04 17:20 UTC (permalink / raw)
  To: gcc

I completed a Fedora rawhide rebuild with an instrumented GCC (~14,500
packages).  156 packages failed to build with a logged -Wint-conversion
error.  This number is much lower than what I expected, and I think we
should include -Wint-conversion in the GCC 14 changes.

My instrumentation isn't very good and has false positives due to
cascading errors, such as this example from Emacs:

conftest.c: In function 'main':
conftest.c:246:21: error: passing argument 1 of 'pthread_setname_np' makes integer from pointer without a cast
  246 | pthread_setname_np ("a");
      |                     ^~~
      |                     |
      |                     char *
In file included from conftest.c:242:
/usr/include/pthread.h:463:42: note: expected 'pthread_t' {aka 'long unsigned int'} but argument is of type 'char *'
  463 | extern int pthread_setname_np (pthread_t __target_thread, const char *__name)
      |                                ~~~~~~~~~~^~~~~~~~~~~~~~~
conftest.c:246:1: error: too few arguments to function 'pthread_setname_np'
  246 | pthread_setname_np ("a");
      | ^~~~~~~~~~~~~~~~~~
/usr/include/pthread.h:463:12: note: declared here
  463 | extern int pthread_setname_np (pthread_t __target_thread, const char *__name)
      |            ^~~~~~~~~~~~~~~~~~

The error at column 21 is logged, even though it is harmless because the
compilation can never succeed because of the wrong argument count.

That's why I think the number of failing builds 156 is really quite low,
and we should be able to manage on the Fedora side.  I'll eventually do
another rebuild with better instrumentation (one that also handles
waivers for implicitly declared functions; currently we get errors from
those because their type is still treated as int internally; maybe I
should switch to error_mark_node for that).

Thanks,
Florian


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: -Wint-conversion as errors seems doable for GCC 14
  2023-10-04 17:20 -Wint-conversion as errors seems doable for GCC 14 Florian Weimer
@ 2023-10-09  6:26 ` Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-10-09  6:26 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc


Florian Weimer via Gcc <gcc@gcc.gnu.org> writes:

> I completed a Fedora rawhide rebuild with an instrumented GCC (~14,500
> packages).  156 packages failed to build with a logged -Wint-conversion
> error.  This number is much lower than what I expected, and I think we
> should include -Wint-conversion in the GCC 14 changes.
>
>[...]
>
> That's why I think the number of failing builds 156 is really quite low,
> and we should be able to manage on the Fedora side.

Yeah, this was my conclusion as well. For glibc in particular, it was
very low impact indeed - and for musl, the hits were all really broken
code.

Given we still, in theory, have some time (although not much) here,
would you mind scheduling a build with -Wincompatible-pointer-types
just to see what the fallout is on your end? Mainly interested in
the numbers. But I won't push my luck if you either don't have
time to run that or the list is large.

For us, it's been clouded by the fact that Vala is broken (so
a lot of bugs have the same root cause), and then the other
stuff was mixed.

thanks,
sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-09  6:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 17:20 -Wint-conversion as errors seems doable for GCC 14 Florian Weimer
2023-10-09  6:26 ` Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).