Torsten Landschoff
2015-08-28 22:16:26 UTC
Hello,
I was recently asked by the Debian reproducible builds team if SWIG
could be extended to support the -Wdate-time warning option.
Actually the suggestion was to ignore all unknown -Wwhatever flags that
are not known to SWIG - see the full text here:
https://bugs.debian.org/790102
not without making a bit of noise on stderr. Even than I'd rather have a
tool understand all options that I passed. So just swallowing all -W
options appears a bit over the top to me.
And of course gcc is not the only compiler used in together with SWIG so
where would that stop? Here are the warning options supported by GCC and
Visual Studio CL compilers:
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/Warning-Options.html#Warning-Options
https://msdn.microsoft.com/en-us/library/vstudio/thxezb7y%28v=vs.100%29.aspx
Solution (b) would be better since we can not be sure that swig options
will not one day conflict with compiler options of the same name.
However, currently only -Wdate-time seems to pose a problem and swig
already accepts -Wall. Therefore I propose to make a pragmatic change to
allow -Wdate-time as well and postpone a discussion about handling of
random CPPFLAGS thrown at swig.
I just created a pull request which just adds -Wdate-time as an accepted
but ignored command line option:
https://github.com/swig/swig/pull/511
Greetings, Torsten
------------------------------------------------------------------------------
I was recently asked by the Debian reproducible builds team if SWIG
could be extended to support the -Wdate-time warning option.
Actually the suggestion was to ignore all unknown -Wwhatever flags that
are not known to SWIG - see the full text here:
https://bugs.debian.org/790102
Hi subversion, unbound and swig maintainers,
we in the Reproducible Builds effort use a non default dpkg which export
-Wdate-time through dpkg-buildflags.
There are package that pass CPPFLAGS (for example) quite unchanged to swig.
Sadly swig does not recognize -Wdate-time and choke and fail on it badly, e.g.
/usr/bin/swig -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/python2.7 -I/usr/include/python2.7 -o pythonmod/interface.h -python ./pythonmod/interface.i
swig error : Unrecognized option -Wdate-time
Use 'swig -help' for available options.
Makefile:369: recipe for target 'pythonmod/interface.h' failed
make[1]: *** [pythonmod/interface.h] Error 1
Needless to say, I'd like to build those packages with such flag (that we also
would like to get into the default set, see the bug #762683 for a start).
a. swig stops failing so badly on unrecognized options. If you really want to
validate the options at least stop failing on unrecognized -W? Seems quite
logical to pass CPPFLAGS to swig to me, and as such sounds sane
b. people stop passing CPPFLAGS to swig. I've already saw a "CPPFLAGS cleaner"
on subversion's configure script. Please I don't want to see another
Even if I do have preference I don't have a strong opinion on this, so if you
agree this is not a bug in swig (which I could even accept, given that the
accepted flags are well documented), I'll just clone+reassign this bug around.
IMHO SWIG should not just ignore any unknown warning setting, at leastwe in the Reproducible Builds effort use a non default dpkg which export
-Wdate-time through dpkg-buildflags.
There are package that pass CPPFLAGS (for example) quite unchanged to swig.
Sadly swig does not recognize -Wdate-time and choke and fail on it badly, e.g.
/usr/bin/swig -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/python2.7 -I/usr/include/python2.7 -o pythonmod/interface.h -python ./pythonmod/interface.i
swig error : Unrecognized option -Wdate-time
Use 'swig -help' for available options.
Makefile:369: recipe for target 'pythonmod/interface.h' failed
make[1]: *** [pythonmod/interface.h] Error 1
Needless to say, I'd like to build those packages with such flag (that we also
would like to get into the default set, see the bug #762683 for a start).
a. swig stops failing so badly on unrecognized options. If you really want to
validate the options at least stop failing on unrecognized -W? Seems quite
logical to pass CPPFLAGS to swig to me, and as such sounds sane
b. people stop passing CPPFLAGS to swig. I've already saw a "CPPFLAGS cleaner"
on subversion's configure script. Please I don't want to see another
Even if I do have preference I don't have a strong opinion on this, so if you
agree this is not a bug in swig (which I could even accept, given that the
accepted flags are well documented), I'll just clone+reassign this bug around.
not without making a bit of noise on stderr. Even than I'd rather have a
tool understand all options that I passed. So just swallowing all -W
options appears a bit over the top to me.
And of course gcc is not the only compiler used in together with SWIG so
where would that stop? Here are the warning options supported by GCC and
Visual Studio CL compilers:
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/Warning-Options.html#Warning-Options
https://msdn.microsoft.com/en-us/library/vstudio/thxezb7y%28v=vs.100%29.aspx
Solution (b) would be better since we can not be sure that swig options
will not one day conflict with compiler options of the same name.
However, currently only -Wdate-time seems to pose a problem and swig
already accepts -Wall. Therefore I propose to make a pragmatic change to
allow -Wdate-time as well and postpone a discussion about handling of
random CPPFLAGS thrown at swig.
I just created a pull request which just adds -Wdate-time as an accepted
but ignored command line option:
https://github.com/swig/swig/pull/511
Greetings, Torsten
------------------------------------------------------------------------------