Subject: |
[Bug 1853148] Re: mingw compiler problem with printf/scanf formats |
From: |
Andrew Johnson via Core-talk <[email protected]> |
To: |
[email protected] |
Date: |
Tue, 19 Nov 2019 17:50:39 -0000 |
We've been seeing this warning for a long time but haven't known about a
fix for it. From the links you posted it would appear that adding the
flag -D__USE_MINGW_ANSI_STDIO to OP_SYS_CPPFLAGS in
configure/os/CONFIG.Common.win32-x86-mingw might solve it (for 64-bit
builds as well), although when I just tried that it doesn't seem to
silence the warnings:
/usr/bin/x86_64-w64-mingw32-g++ -DUSE_TYPED_RSET -I../../pdbApp -I../../p2pApp -I../../common -DNOMINMAX -D_MINGW -D__USE_MINGW_ANSI_STDIO -O3 -Wall -m64 -DEPICS_BUILD_DLL -DEPICS_CALL_DLL -I. -I../O.Common -I. -I. -I.. -I/local/anj/base-7.0/include/compiler/gcc -I/local/anj/base-7.0/include/os/WIN32 -I/local/anj/base-7.0/include -I/local/anj/base-7.0/include/compiler/gcc -I/local/anj/base-7.0/include/os/WIN32 -I/local/anj/base-7.0/include -o testpdb.obj -c ../testpdb.cpp
../testpdb.cpp: In function 'int main(int, char**)':
../testpdb.cpp:310:99: warning: unknown conversion type character 'z' in format [-Wformat=]
testDiag("Cnt %s = %zu (%ld)", it->first.c_str(), it->second.current, it->second.delta);
^
../testpdb.cpp:310:99: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t {aka long long unsigned int}' [-Wformat=]
../testpdb.cpp:310:99: warning: too many arguments for format [-Wformat-extra-args]
../testpdb.cpp:348:99: warning: unknown conversion type character 'z' in format [-Wformat=]
testDiag("Cnt %s = %zu (%ld)", it->first.c_str(), it->second.current, it->second.delta);
^
../testpdb.cpp:348:99: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t {aka long long unsigned int}' [-Wformat=]
../testpdb.cpp:348:99: warning: too many arguments for format [-Wformat-extra-args]
My gcc cross-compiler is from RHEL-7, so maybe it might still help with a newer gcc/MinGW version:
tux% x86_64-w64-mingw32-g++ --version
x86_64-w64-mingw32-g++ (GCC) 4.9.3 20150626 (Fedora MinGW 4.9.3-1.el7)
If someone sees that it does help on newer versions I can add that flag
to 3.15.
** Changed in: epics-base
Status: New => Triaged
** Changed in: epics-base
Importance: Undecided => Low
--
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1853148
Title:
mingw compiler problem with printf/scanf formats
Status in EPICS Base:
Triaged
Bug description:
../db/dbJLink.c: In function ‘dbjl_integer’:
../db/dbJLink.c:136:16: warning: unknown conversion type character ‘l’ in format [-Wformat=]
printf("dbjl_integer(%s@%p, %lld)\n",
^
../db/dbJLink.c:136:16: warning: too many arguments for format [-Wformat-extra-args]
It seems that mingw does not like "%lld".
To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1853148/+subscriptions
- References:
- [Bug 1853148] [NEW] mingw compiler problem in dbJLink.c Dirk Zimoch via Core-talk
- Navigate by Date:
- Prev:
[Bug 1853168] Re: undefined reference to `clock_gettime' Martin Konrad via Core-talk
- Next:
[Bug 1853168] Re: undefined reference to `clock_gettime' mdavidsaver via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
[Bug 1853148] Re: mingw compiler problem with printf/scanf formats Dirk Zimoch via Core-talk
- Next:
[Bug 1853148] Re: mingw compiler problem with printf/scanf formats mdavidsaver via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
|