Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.devel > #112119

Re: Enabling some -Werror=format* by default?

From Andrey Rakhmatullin <wrar@debian.org>
Newsgroups linux.debian.devel
Subject Re: Enabling some -Werror=format* by default?
Date 2024-06-10 17:10 +0200
Message-ID <INOOK-1WRi-9@gated-at.bofh.it> (permalink)
References <IMqOt-15Qz-5@gated-at.bofh.it> <INKBr-1Uc9-3@gated-at.bofh.it> <INL4u-1UBt-9@gated-at.bofh.it> <INOc1-1Woq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Jun 10, 2024 at 04:24:54PM +0200, Guillem Jover wrote:
> > > > We recently increased the time_t size on certain architectures and some
> > > > packages started failing to build because they were using a format
> > > > specifier too narrow for the wider time_t, e.g. #1067829.
> > > > But the only reason those package FTBFS is they enable either -Werror or
> > > > some more specific non-default switch like -Werror=format=2, so I suspect
> > > > much more packages contain similar code but gained only a warning. Isn't
> > > > this a bad thing? Should we enable at least some combination of -Wformat*
> > > > switches by default? Should we at least add a new flag to dpkg-buildflags
> > > > and do some test rebuilds with it enabled?
> > > 
> > > It wasn't quite clear to me what -Werror=format=2 actually means.
> > > According to the gcc documentation[1], -Wformat=2 currently means:
> > > 
> > >     -Wformat -Wformat-nonliteral -Wformat-security -Wformat-y2k.
> 
> Those are in addition to the ones enabled by -Wformat=1, which are:

(note that -Wformat is already included in that list)

>   -Wnonnull -Wno-format-contains-nul -Wno-format-extra-args
>   -Wno-format-zero-length

(note that -Wformat is not equal to these flags, it just implies -Wnonnull
and those three -Wno-* can be used to turn off some parts of it)


> In general I think it's good (in principle) to enable -Werror flags
> that detect actual bugs in code, the problem is always going to be
> the amount of fallout and work that creates, and whether there's
> consensus about that work commitment being acceptable to maintainers
> in Debian, or whether that can interfere with transitions going on,
> etc.

Yeah.

> > > It also is unclear how this impacts the archive and yes, I'd recommend a
> > > rebuild. Note though that we likely need this rebuild both on a 64bit
> > > architecture and a 32bit architecture that is not i386 (due to how t64
> > > works). A partial archive rebuild may work to gauge the size of the
> > > problem.
> > > 
> > > I note that this kind of change affects cross builds, so performing
> > > cross builds for armhf on amd64 will likely show many of these failures
> > > (in addition to all the regular cross build failures).
> > > 
> > > I recommend doing more research before moving forward with this. In
> > > particular a MBF about introduced problems would be prudent before doing
> > > the switch and even if we don't switch, such a MBF bears value on its
> > > own.
> 
> > Do you think it makes sense to add this a flag that enables -Werror=format
> > to dpkg-buildflags(1), before, or after a test rebuild, before, or after
> > the MBF if we do one?
> 
> If by adding you mean adding a new feature flag that is disabled by
> default, then depending on the feature area, that might unfortunately
> be equivalent to enable it by default (due to the «all» keyword).

That's a good point, though hopefully people who use "all" understand the
implication...

-- 
WBR, wRAR

Back to linux.debian.devel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Enabling some -Werror=format* by default? Andrey Rakhmatullin <wrar@debian.org> - 2024-06-06 21:20 +0200
  Re: Enabling some -Werror=format* by default? Helmut Grohne <helmut@subdivi.de> - 2024-06-10 12:40 +0200
    Re: Enabling some -Werror=format* by default? Andrey Rakhmatullin <wrar@debian.org> - 2024-06-10 13:10 +0200
      Re: Enabling some -Werror=format* by default? Guillem Jover <guillem@debian.org> - 2024-06-10 16:30 +0200
        Re: Enabling some -Werror=format* by default? Andrey Rakhmatullin <wrar@debian.org> - 2024-06-10 17:10 +0200
          Re: Enabling some -Werror=format* by default? Guillem Jover <guillem@debian.org> - 2024-06-10 18:30 +0200
        Re: Enabling some -Werror=format* by default? Andrey Rakhmatullin <wrar@debian.org> - 2024-06-10 17:10 +0200
        Re: Enabling some -Werror=format* by default? Simon McVittie <smcv@debian.org> - 2024-06-10 17:10 +0200
      Re: Enabling some -Werror=format* by default? Helmut Grohne <helmut@subdivi.de> - 2024-06-10 18:30 +0200
        Re: Enabling some -Werror=format* by default? Fay Stegerman <flx@obfusk.net> - 2024-06-11 03:00 +0200
        Re: Enabling some -Werror=format* by default? Guillem Jover <guillem@debian.org> - 2024-06-11 12:10 +0200

csiph-web