Re: Performance, for(int i...) vs for(i...)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim Prince schrieb:
On 08/26/2012 11:30 AM, lab@xxxxxxxxxxxxx wrote:
Hello, I like performance, and until last month i follow what I see on the web to do better coding for performance, like:

- Avoid i++, use ++i and so on.

But now i'm using the assembly (-S) code generated to see if somethings is correct, and today i'm investigating this:

int i;
for(i = 0;....);

vs

for(int i = 0;...);

[...] It's probably important to continue to handle the declaration
outside  the scope well, as that version is required for C source code
by Microsoft compilers, even VS2012.
I have had occasion to wish that people didn't rely on non-standard maybe Microsoft is right in forbidding both incorrect and correct C++
usage in C code.

It's all vanilla C99, no C++ is needed for that.

Just activate that language standard in your C compiler ;-)

Johann




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux