Re: Using -Werror in CFLAGS for a debian package build
Didier Raboud <odyx@debian.org> writes:
> Wouter Verhelst wrote:
>
>> I was working on nbd-server upstream, and so had ran ./configure with
>> CFLAGS='-Wall -Werror', which I consider good practice when writing C
>> code.
>>
>> What I didn't notice immediately was that gcc was emitting some
>> warnings, but that the -Werror option was not honored for those
>> warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
>> have decided to disable -Werror for some new warnings, because otherwise
>> it would cause FTBFS bugs in packages that have -Werror set in their
>> debian/rules file.
>
> Wouldn't it be possible to use the dpkg-buildflags framework for this? As
> far as I understand it, this framework sets the gcc options used to build
> Debian packages. Using it would allow to have an upstream-like gcc for the
> whole system, and Debian-specific options when building packages.
>
> (It would also have the side-effect of making sure all packages actually
> work fine when dpkg-buildflags sets something different as usually
> expected.)
>
> Opinions ?
You would want to only have -Werror for your own packages, not for every
package you compile. dpkg-buildflags doesn't know what package you are
trying to build when it gets asked for the right flags to use.
MfG
Goswin
Reply to: