Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #43914 > unrolled thread

"Code behaving differently in C90, C99, C11, C++98, and C++11"

Started byLynn McGuire <lmc@winsim.com>
First post2016-07-25 16:50 -0500
Last post2016-07-26 12:15 -0600
Articles 4 — 3 participants

Back to article view | Back to comp.lang.c++


Contents

  "Code behaving differently in C90, C99, C11, C++98, and C++11" Lynn McGuire <lmc@winsim.com> - 2016-07-25 16:50 -0500
    Re: "Code behaving differently in C90, C99, C11, C++98, and C++11" Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-25 17:42 -0600
      Re: "Code behaving differently in C90, C99, C11, C++98, and C++11" red floyd <no.spam@its.invalid> - 2016-07-26 10:12 -0700
        Re: "Code behaving differently in C90, C99, C11, C++98, and C++11" Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-07-26 12:15 -0600

#43914 — "Code behaving differently in C90, C99, C11, C++98, and C++11"

FromLynn McGuire <lmc@winsim.com>
Date2016-07-25 16:50 -0500
Subject"Code behaving differently in C90, C99, C11, C++98, and C++11"
Message-ID<nn61jt$9e7$1@dont-email.me>
"Code behaving differently in C90, C99, C11, C++98, and C++11"
    https://kristerw.blogspot.com/2016/07/code-behaving-differently-in-c90-c99.html

"There are some subtle differences between the revisions of the C standard that makes it possible to create programs that behaves 
differently depending on if they are compiled as C90, C99, or C11. Similarly, C++ is mostly a superset of C, but there are constructs 
that produce different results for C and C++."

"For C99 the stars have eyes, C++11 prints circles, etc. (There is more to this. The program reads text from standard input, and the 
output is obfuscated C90 source code that prints that text — all the * characters are pointer dereferences!)"

Ok, the source code picture is cool.

Lynn

[toc] | [next] | [standalone]


#43917

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2016-07-25 17:42 -0600
Message-ID<1btwfdffo9.fsf@pfeifferfamily.net>
In reply to#43914
Lynn McGuire <lmc@winsim.com> writes:

> "Code behaving differently in C90, C99, C11, C++98, and C++11"
>    https://kristerw.blogspot.com/2016/07/code-behaving-differently-in-c90-c99.html
>
> "There are some subtle differences between the revisions of the C
> standard that makes it possible to create programs that behaves
> differently depending on if they are compiled as C90, C99, or
> C11. Similarly, C++ is mostly a superset of C, but there are
> constructs that produce different results for C and C++."
>
> "For C99 the stars have eyes, C++11 prints circles, etc. (There is
> more to this. The program reads text from standard input, and the
> output is obfuscated C90 source code that prints that text — all the *
> characters are pointer dereferences!)"
>
> Ok, the source code picture is cool.

Writing stuff like this takes a special kind of crazy.

[toc] | [prev] | [next] | [standalone]


#43925

Fromred floyd <no.spam@its.invalid>
Date2016-07-26 10:12 -0700
Message-ID<nn85mq$p75$2@dont-email.me>
In reply to#43917
On 7/25/2016 4:42 PM, Joe Pfeiffer wrote:
> Lynn McGuire <lmc@winsim.com> writes:
>
>> "Code behaving differently in C90, C99, C11, C++98, and C++11"
>>     https://kristerw.blogspot.com/2016/07/code-behaving-differently-in-c90-c99.html
>>
>> "There are some subtle differences between the revisions of the C
>> standard that makes it possible to create programs that behaves
>> differently depending on if they are compiled as C90, C99, or
>> C11. Similarly, C++ is mostly a superset of C, but there are
>> constructs that produce different results for C and C++."
>>
>> "For C99 the stars have eyes, C++11 prints circles, etc. (There is
>> more to this. The program reads text from standard input, and the
>> output is obfuscated C90 source code that prints that text — all the *
>> characters are pointer dereferences!)"
>>
>> Ok, the source code picture is cool.
>
> Writing stuff like this takes a special kind of crazy.
>

Well, it *was* the IOCCC.  What did you expect?  :)

[toc] | [prev] | [next] | [standalone]


#43927

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2016-07-26 12:15 -0600
Message-ID<1bpoq0feqe.fsf@pfeifferfamily.net>
In reply to#43925
red floyd <no.spam@its.invalid> writes:

> On 7/25/2016 4:42 PM, Joe Pfeiffer wrote:
>> Lynn McGuire <lmc@winsim.com> writes:
>>
>>> "Code behaving differently in C90, C99, C11, C++98, and C++11"
>>>     https://kristerw.blogspot.com/2016/07/code-behaving-differently-in-c90-c99.html
>>>
>>> "There are some subtle differences between the revisions of the C
>>> standard that makes it possible to create programs that behaves
>>> differently depending on if they are compiled as C90, C99, or
>>> C11. Similarly, C++ is mostly a superset of C, but there are
>>> constructs that produce different results for C and C++."
>>>
>>> "For C99 the stars have eyes, C++11 prints circles, etc. (There is
>>> more to this. The program reads text from standard input, and the
>>> output is obfuscated C90 source code that prints that text — all the *
>>> characters are pointer dereferences!)"
>>>
>>> Ok, the source code picture is cool.
>>
>> Writing stuff like this takes a special kind of crazy.
>>
>
> Well, it *was* the IOCCC.  What did you expect?  :)

I didn't say it was unexpected!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web