Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"07-13-10 - Tech Blurg"

7 Comments -

1 – 7 of 7
Blogger Mojo said...

"%lli", "%llu".

The gcc/msvc syntax thing is retarded but c++ sucks more for not having defined where extention decorators or attributes should go.

July 14, 2010 at 3:51 AM

Blogger cbloom said...

"%lli", "%llu".

Bleck. So to use this you have to do something like

#define I64D "%lli"

then to printf you do

printf("what : " I64D "\n",num);

so gross.

Of course in cblib I would just use something like

printf("what : %s"\n",StrNum(num).CStr());

but I can't do that in RAD non-C++ land.

July 14, 2010 at 10:35 AM

Blogger Julien Koenen said...

We invested a couple hours some time ago to implement our own versions of sprintf/vsnprintf and use those exclusively on all platforms. That helped a lot with other issues as well (Like replacing ',' with '.' in german localization and other fun...)

July 14, 2010 at 12:45 PM

Blogger won3d said...

Yeah, the whole format string thing is a disaster.

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=64-bit_Portability#64-bit_Portability

July 14, 2010 at 2:08 PM

Blogger Ian Romanick said...

vsnprintf is C99. _vsprintf is MS rubbish. MS needs to pull their heads out of their asses and support the TEN YEAR OLD C standard. Most of the extensions in GCC *predate* the similar extensions in MSVC. So, to be fair, it's acutally just MS being dicks. Big f'ing surprise.

July 15, 2010 at 10:59 AM

Blogger cbloom said...

"MS needs to pull their heads out of their asses and support the TEN YEAR OLD C standard"

Hmm, yeah okay, you have a point.

But the stdlib names are not really the worst part because you can just #define them to match, it's all the extra stuff outside the standard (pragma pack, align, etc) that are the worst problems.

July 16, 2010 at 3:28 PM

Blogger Chris Green said...

%lld and %llu work on both compilers afaik.

July 16, 2010 at 4:24 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.