Re: glib bug on windows?
- From: Tor Lillqvist <tml iki fi>
- To: Hubert Sokołowski <h sokolowski wsisiz edu pl>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: glib bug on windows?
- Date: Wed, 27 Jul 2005 17:49:50 +0300
Hubert =?ISO-8859-2?Q?Soko=B3owski?= writes:
%% works fine, thanks. but it is strange that \% works on linux and on
windows it doesn't.
What's so strange with that? The standard way to get a '%' through
printf() and friends has always been to double it. \% isn't even
mentioned in the man page for printf() on Linux.
\% is doubly confusing as the escape sequences starting with \ used in
string literals are interpreted already by the compiler. As far as I
know using the sequence \% in a string might invoke undefined
behaviour in the compiler. Apparently gcc chooses to store both the \
and % in the string literal as such (compare to for instance \n which
stores just one char in the string literal), so they get passed on to
printf.
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]