------- Comment #23 from rogerio at rilhas dot com 2010-08-12 17:25 ------- (In reply to comment #19) > Everyone understands it, you're just wrong.
No I'm not, the problem seems to be just to complex for you because you would have to tie up C99+cdecl to understand, but you don't understand it because you don't know "cdecl language" (this still makes me laugh!) and so you don't get out of your little C99 box (which makes you lose sight of the big picture). char* p1=random_address(); char* p2=another_random_address(); Any compiler that does not predictably compute p2-p1 is a piece of crap. You can twist C99 all you want, but whenever p2-p1 is left to some undefined criteria of the compiler then it is just an absolute piece of crap. Period. That is why no compiler leaves this indefined, even GCC (apparently it was just luck). This should be enough for you to see you are not getting C99 right, because following what you say would create crappy compilers. Feel free to try and prove they would not be crappy. Even if you could convince me of your interpretation of C99 and p2-p1 were not well defined, you would still have to explain why "&strp" is not 4 bytes before "&i" (not subtracting, just looking at their disassembled addresses). This is the big picture that you do not understand, you just keep deflecting. ... while we discuss GCC still doesn't return the correct address for "&strp". So, let me just summarize by saying I was so so so so wrong to expect GCC to have returned the address that my little brain expected to result from the combination C99+cdecl. Of course I was wrong and you were right, which makes me stupit and you smart. Meanwhile everyone else knows that "if it compiles in GCC and executes correctly then it compiles and executes correctly in any other compiler"... can you deduce why? Does it make you proud? ... hint: which do you think is the compiler with the most reduced capabilities that serves as a baseline for your code? Would you like to keep GCC at this low end of the spectrum? Good, just keep on insisting on your interpretation of C99. http://en.wikipedia.org/wiki/GNU_Compiler_Collection "In 2007, GCC received criticism from one OpenBSD developer who complained that GCC is mostly developed by companies, that it is large, buggy, slow, and that it generates poor code,[31][not in citation given][32] and who also dislike v3 of the GNU GPL.[33] The OpenBSD project and FreeBSD projects, respectively, are experimenting with replacing GCC with the Portable C Compiler[33] and Clang/LLVM.[34] The NetBSD and DragonFlyBSD projects have commented that on replacing GCC, they have explored various compiler replacements but have no solid answers.[35]" (I've checked the references, they are fine!!) Does it have anything to do that you dismiss people who find and show you bugs? Maybe you do a good job when you quickly send them away after stamping it with "non-conformant", I don't know, but I expected a little more interest on your part to make GCC better. I would be open to anything, including something along the lines of "ok, it is not a bug, but we will consider this as a feature request"... but not even that. I'll come back some day (be afraid!! :-) ) with a list of compilers tested to see how many produce correct results for this bug report. For now in 4 compilers tested (2 from Microsoft) 3 of them do the job correctly and GCC is the only one that doesn't. Oopss...! I meant: GCC is the only one to have correctly interpreted C99, the other 3 got it wrong and let me get the addresses of the parameters as I wrongfully expected. And let me subtract them predictably. This surelly proves you are very insightfull and that you know C99 better than anyone else. Gone, sorry for any inconvenience. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45265