This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++ -pedantic warns erroneously for POSIX strftime()


(I haven't been able to use gnatsweb to report this, therefore I must
email it...)

Hello!

I've a piece of C++ code named strftime.C:

#include <ctime>
int main() {
  std::strftime(NULL, 0, "%T", NULL);
}

Which compiled with g++ 3.2 like:

$> g++ -pedantic -Wformat strftime.C

says:

strftime.C: In function `int main()':
strftime.C:3: warning: ISO C++ does not support the `%T' strftime format

That has been true earlier, but now POSIX 1003.1-2001, e.g.

http://www.opengroup.org/onlinepubs/007904975/functions/strftime.html

says that POSIX C supports %T and as the ISO C++ Standard says that
C functions are externally defined by POSIX or other bodies, I would
conclude that the warning is outdated.

Yours,

Jorma Laaksonen

-- 
Jorma Laaksonen                                 email: jorma.laaksonen@hut.fi
Dr. of Science in Technology, Docent            http://www.cis.hut.fi/jorma/
Laboratory of Computer and Information Science  tel. +358-9-4513269
Helsinki University of Technology               fax. +358-9-4513277
P.O.Box 5400, Fin-02015 HUT, Finland            mob. +358-50-3058719


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]