From: SF/projects/mingw n. l. <min...@li...> - 2011-08-11 16:06:08
|
Support Requests item #3390077, was opened at 2011-08-11 16:40 Message generated for change (Comment added) made by bvassche You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=202435&aid=3390077&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: Unsupported Usage >Status: Open Priority: 5 Private: No Submitted By: (bvassche) Assigned to: Nobody/Anonymous (nobody) Summary: Mismatch between size_t and ssize_t Initial Comment: Apparently size_t is a synonym for unsigned int and ssize_t for long (<sys/types.h>), which causes strange failure reports: $ printf '#include <stdio.h>\nint main(int argc, char** argv){size_t s = 1; ssize_t ss = -2; printf("%%u %%d\\n", s, ss); return 0;}'|gcc -xc - -Wall -Werror; echo $? cc1.exe: warnings being treated as errors <stdin>: In function 'main': <stdin>:2:1: error: format '%d' expects type 'int', but argument 3 has type 'ssize_t' 1 $ printf '#include <stdio.h>\nint main(int argc, char** argv){size_t s = 1; ssize_t ss = -2; printf("%%u %%ld\\n", s, ss); return 0;}'|gcc -xc - -Wall -Werror ; echo $? 0 Details: Windows version: Windows XP $ gcc -v Using built-in specs. COLLECT_GCC=C:\MinGW\bin\gcc.exe COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 -prefix=/mingw Thread model: win32 gcc version 4.5.2 (GCC) $ uname -a MINGW32_NT-5.1 PS3002 1.0.11(0.46/3/2) 2009-07-11 17:46 i686 Msys ---------------------------------------------------------------------- >Comment By: (bvassche) Date: 2011-08-11 18:06 Message: > Or are you indicating that ssize_t should be int instead of long? Indeed. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2011-08-11 17:36 Message: Didn't mean to close this one. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2011-08-11 17:34 Message: Note, since this is not a but I changed this to a Support Request. You gave two uses, one incorrect and one correct. How is this a bug? Or are you indicating that ssize_t should be int instead of long? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=202435&aid=3390077&group_id=2435 |