develooper Front page | perl.perl5.porters | Postings from August 2019

[perl #134363] Odd warning in simple XSub (-Dusequadmath buildsonly)

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
August 26, 2019 02:21
Subject:
[perl #134363] Odd warning in simple XSub (-Dusequadmath buildsonly)
Message ID:
rt-4.0.24-17595-1566786069-1341.134363-15-0@perl.org
On Mon, 26 Aug 2019 02:14:57 GMT, tonyc wrote:
> On Mon, 19 Aug 2019 23:44:18 -0700, sisyphus359@gmail.com wrote:
> > OS is Ubuntu-18.04, current compiler is gcc-7.4.0.
> > I can't find a -Dusequadmath build on the system that doesn't issue
> > the
> > warning.
> > I've tested:
> > (v5.31.2) built for x86_64-linux-quadmath
> > (v5.30.0) built for x86_64-linux-quadmath
> > (v5.28.0) built for x86_64-linux-quadmath
> > (v5.26.0) built for x86_64-linux-thread-multi-quadmath
> > (v5.24.0) built for x86_64-linux-thread-multi-quadmath
> > (v5.22.0) built for x86_64-linux-thread-multi-quadmath
> 
> What I think is happening, is somehow, -Wformat is enabled by default
> on your gcc, similarly for James.
> 
> I don't see anything in the gcc release notes indicating that it was
> turned on by default, but it may have been omitted.
> 
> While building perl with a quadmath build, the build of perl itself
> and the bundled modules includes a -Wno-format, since gcc's -Wformat
> checks don't understand the Q size modifier.
> 
> This addition of -Wno-format isn't used while building CPAN modules
> after perl is installed though, so you see the warnings.
> 
> If you want to check if format warnings are on by default, try
> building this code:
> 
> #include <stdio.h>
> 
> extern __float128 x;
> 
> void f(void) {
>     printf("%Qf", x);
> }
> 
> with:
> 
> cc -c test.c
> 
> which doesn't warn here with gcc 6.3.0.
> 

$ uname -mrs
Linux 4.15.0-58-generic x86_64

$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

$ gcc -c 134363-test.c 
134363-test.c: In function ‘f’:
134363-test.c:6:14: warning: unknown conversion type character ‘Q’ in format [-Wformat=]
     printf("%Qf", x);
              ^
134363-test.c:6:12: warning: too many arguments for format [-Wformat-extra-args]
     printf("%Qf", x);
            ^~~~~

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134363

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About