bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warnings when compiling Binutils 2.25 on MinGW


From: Eli Zaretskii
Subject: Warnings when compiling Binutils 2.25 on MinGW
Date: Fri, 20 Mar 2015 12:25:45 +0200

For these 3 warnings I already suggested a patch:

  mingw32-gcc -c -DHAVE_CONFIG_H -Og -g3 -D__USE_MINGW_ACCESS  -I. 
-I../../binutils-2.25/libiberty/../include  -W -Wall -Wwrite-strings 
-Wc++-compat -Wstrict-prototypes -pedantic  
../../binutils-2.25/libiberty/strerror.c -o strerror.o
  In file included from ../../binutils-2.25/libiberty/strerror.c:31:0:
  ../../binutils-2.25/libiberty/strerror.c:472:12: warning: '_sys_nerr' 
redeclared without dllimport attribute: previous dllimport ignored 
[-Wattributes]
   extern int sys_nerr;
              ^
  ../../binutils-2.25/libiberty/strerror.c:473:14: warning: '_sys_errlist' 
redeclared without dllimport attribute: previous dllimport ignored 
[-Wattributes]
   extern char *sys_errlist[];
                ^
  mingw32-gcc -c -DHAVE_CONFIG_H -Og -g3 -D__USE_MINGW_ACCESS  -I. 
-I../../binutils-2.25/libiberty/../include  -W -Wall -Wwrite-strings 
-Wc++-compat -Wstrict-prototypes -pedantic  
../../binutils-2.25/libiberty/setenv.c -o setenv.o
  ../../binutils-2.25/libiberty/setenv.c:66:1: warning: function declaration 
isn't a prototype [-Wstrict-prototypes]
   extern char **environ;
   ^

Those patches were approved, respectively, in

  https://sourceware.org/ml/gdb-patches/2015-01/msg00484.html

and in

  https://sourceware.org/ml/gdb-patches/2013-03/msg00598.html

I guess people who approved them thought I had write access to the
master libiberty repo, which I don't.  Please, could someone commit
those for me, so I don't have to fix this by hand forever?  Thanks in
advance.

The 3rd warning is AFAIR new:

  mingw32-gcc -c -DHAVE_CONFIG_H -Og -g3 -D__USE_MINGW_ACCESS  -I. 
-I../../binutils-2.25/libiberty/../include  -W -Wall -Wwrite-strings 
-Wc++-compat -Wstrict-prototypes -pedantic  
../../binutils-2.25/libiberty/d-demangle.c -o d-demangle.o
  ../../binutils-2.25/libiberty/d-demangle.c: In function 'dlang_parse_real':
  ../../binutils-2.25/libiberty/d-demangle.c:885:3: warning: unknown conversion 
type character 'L' in format [-Wformat=]
     len = snprintf (buffer, sizeof(buffer), "%#Lg", value);
     ^
  ../../binutils-2.25/libiberty/d-demangle.c:885:3: warning: too many arguments 
for format [-Wformat-extra-args]

The usual way of fixing this is to use -D__USE_MINGW_ANSI_STDIO cpp
flag, which triggers redirection of stdio routines to ANSI compliant
versions in the MinGW library, instead of using the Microsoft runtime
which doesn't support printing long double values.  I suggest that the
configure script automatically turns that cpp flag on for MinGW.

While trying to resolve this issue without changing the configure
scripts, I configured with CPPFLAGS='-D__USE_MINGW_ANSI_STDIO', but
for some strange reason this didn't help: the CPPFLAGS setting of the
Makefile's in the subdirectories stayed empty.  Why doesn't that work?
What did I miss?  (I eventually worked around this by sneaking that -D
switch through CFLAGS.)

TIA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]