Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 524 forks source link

Cleanup some build warnings #22128

Closed tonycoz closed 2 weeks ago

jkeenan commented 3 weeks ago

@tonycoz, can you describe how you generate these build warnings, e.g., what config options, which platforms? Thanks.

tonycoz commented 3 weeks ago

what config options, which platforms?

On Debian stable linux:

./Configure -des -Dusedevel -DDEBUGGING
jkeenan commented 3 weeks ago

what config options, which platforms?

On Debian stable linux:

./Configure -des -Dusedevel -DDEBUGGING

@Tonycoz, with that configuration I got no build-time warnings. I tried on Debian at both v5.38.0 and at HEAD on blead. I also tried at HEAD on Ubuntu.

$ uname -mrs
Linux 5.10.0-25-amd64 x86_64

$ gcc --version | head -1
gcc (Debian 10.2.1-6) 10.2.1 20210110

$ ./perl -Ilib -V:config_args
config_args='-des -Dusedevel -DDEBUGGING';

$ report-build-warnings d15f6e9d45.linux.unthreaded.debugging.maketp.output.txt.gz 
File:  d15f6e9d45.linux.unthreaded.debugging.maketp.output.txt.gz

[no output]

What build-time warnings were you getting that led to this pull request?

tonycoz commented 3 weeks ago

What build-time warnings were you getting that led to this pull request?

The warnings in the commit messages.

$ uname -mrs
Linux 5.10.0-25-amd64 x86_64

It looks like you're running Debian oldstable (bullseye) not stable (bookworm):

$ grep PRETTY_NAME /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
$ uname -mrs
Linux 6.1.0-17-amd64 x86_64
$ cat /etc/debian_version 
12.5
$ gcc --version | head -1
gcc (Debian 12.2.0-14) 12.2.0
jkeenan commented 3 weeks ago

Much to my surprise, this incentivized me to do a full upgrade on my server to Debian 12 (bookworm). I can now confirm the presence of two previously unseen build-time warnings on debugging builds.

$ sh ./Configure -des -Dusedevel -DDEBUGGING && make test_prep ...

$ parse-build-warnings e78caca814.linux.unthreaded.debugging.maketp.output.txt.gz 
File:  e78caca814.linux.unthreaded.debugging.maketp.output.txt.gz

[
  {
    char   => 26,
    group  => "Warray-bounds",
    line   => 460,
    source => "hv.h",
    text   => "array subscript [0, 9223372036854775807] is outside array bounds of \xE2\x80\x98char[0]\xE2\x80\x99",
  },
  {
    char   => 28,
    group  => "Wformat-overflow=",
    line   => 4622,
    source => "locale.c",
    text   => "\xE2\x80\x98%s\xE2\x80\x99 directive argument is null",
  },
]

I can further confirm that your patch eliminates these warnings on debugging builds (and does no harm if I compile with clang-14 rather than the default gcc-12.

Do you happen to know what in the Debian upgrade exposed the build-time warnings?

tonycoz commented 2 weeks ago

Do you happen to know what in the Debian upgrade exposed the build-time warnings?

Most likely gcc 12.