Opened 16 years ago
Closed 16 years ago
#2907 closed bug (invalid)
strftime() doesn't support F conversion specifier
Reported by: | scottmc | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | - General | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Not sure if there are other missing options, but I kow at least %F isn't working as expected in Haiku See: http://linux.die.net/man/3/strftime
Change History (7)
comment:1 by , 16 years ago
Summary: | strftime() doesn't support %F conversion specifier → strftime() doesn't support E, F, O and + conversion specifiers |
---|
comment:2 by , 16 years ago
Linux man pages are not a good source for these things, as they often have POSIX incompatible features that we might not always copy.
http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html is a better source of information, but it mentions %F as well :-)
The build warnings are probably due to our old GCC version. '%+' doesn't seem to be in the standard, and you also seem to have used '%O' and '%E' incorrectly, as they are just modifiers and need another specifier.
comment:3 by , 16 years ago
Summary: | strftime() doesn't support E, F, O and + conversion specifiers → strftime() doesn't support F conversion specifier |
---|
Thanks for the link. I bought a used POSIX book c1991: http://www.amazon.com/POSIX-Programmers-Guide-Donald-Lewine/dp/0937175730/ref=sr_1_9?ie=UTF8&s=books&qid=1224749293&sr=8-9 Handy to have in paper form, but doesn't include newer things. It is interesting to note that %F was added to POSIX later on. Changing summary backto just F.
comment:4 by , 16 years ago
%F works fine for me:
#include <stdio.h> #include <time.h> int main() { char buffer[256]; time_t t = time(NULL); strftime(buffer, sizeof(buffer), "date is: %F", localtime(&t)); puts(buffer); return 0; }
Output:
date is: 2008-10-23
Please provide a test case that doesn't work.
follow-up: 6 comment:5 by , 16 years ago
svn checkout svn://svn.berlios.de/pe-editor/trunk jam You'll get a warning in HeaderHeader.cpp, but it still builds, if you try to use HeaderHeader in the resulting pe it will crash.
comment:6 by , 16 years ago
> svn checkout svn://svn.berlios.de/pe-editor/trunk pe > jam You'll get a warning in HeaderHeader.cpp, but it still builds, if you try to use HeaderHeader in the resulting pe it will crash.
If you need pcre, there is a prebuilt image on haikuports, unzip it to /boot and it will be good to go.
comment:7 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
At least here Pe doesn't crash when invoked from inside the root directory (i.e. ./generated/distro/pe
). It does, however, crash when invoked from another directory (e.g. cd generated/distro; ./pe
). The crash happens in strrchr(), which has been passed a NULL pointer by PScriptCmd::Do(). Apparently it failed to get the path.
At any rate this has nothing to do with strftime().
I added a strftime for every one of the modifiers listed in that link above:
Build Results: