// $ i686-w64-mingw32-gcc -Wimplicit-function-declaration ./ftime.c // // /tmp/ccdYAiqO.o:ftime.c:(.text+0x16): undefined reference to`_imp___ftime_s' // collect2: error: ld returned 1 exit status // // No warning, this means the function is declared in headers (gcc -E shows // it comes from sec_api/sys/timeb_s.h) but it's not available at link time. /* $ rpm -qa mingw32* mingw32-binutils-2.22.51-3.fc17_cross.x86_64 mingw32-gcc-4.7.0-0.3.20120123.fc16_cross.x86_64 mingw32-filesystem-92-1.fc18_cross.noarch mingw32-cpp-4.7.0-0.3.20120123.fc16_cross.x86_64 mingw32-headers-2.0.999-0.1.trunk.20120120.fc17_cross.noarch mingw32-crt-2.0.999-0.3.trunk.20120124.fc17_cross.noarch mingw32-gcc-c++-4.7.0-0.3.20120123.fc16_cross.x86_64 */ #include <stdlib.h> // for NULL #include <sys/timeb.h> int main(int argc, char **argv) { _ftime_s(NULL); return 0; }
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
The mentioned testcase gives the expect result and doesn't show any warnings on the mingw-w64 toolchain which is currently in rawhide. Closing bug
I'm still hitting this in f20 with mingw64-gcc, but this seems related to ccache: $ which x86_64-redhat-linux-gcc /usr/lib64/ccache/x86_64-redhat-linux-gcc $ LC_ALL=C x86_64-redhat-linux-gcc -Wimplicit-function-declaration ./mingw.c ./mingw.c: In function 'main': ./mingw.c:6:5: warning: implicit declaration of function '_ftime_s' [-Wimplicit-function-declaration] _ftime_s(NULL); ^ /tmp/ccswArMH.o: In function `main': mingw.c:(.text+0x1a): undefined reference to `_ftime_s' collect2: error: ld returned 1 exit status $ /usr/bin/x86_64-w64-mingw32-gcc -Wimplicit-function-declaration ./mingw.c $ echo $? 0 No clue whether this should be reopened or not.
The symbol _ftime_s is win32 specific and part of the 'secure api': http://msdn.microsoft.com/en-us/library/95e68951.aspx Therefore it is expected that the symbol can't be found when using the native Linux gcc
Sorry, dunno what I was thinking, I did not pay attention to the 'linux' bit in x86_64-redhat-linux-gcc and assumed this was a mingw one /o\, apologies for the noise.