Connecting Tech Pros Worldwide Help | Site Map

Re: C ONE LINER

  #1  
Old November 20th, 2008, 12:45 PM
Dik T. Winter
Guest
 
Posts: n/a
In article <gg29j6$f40$1@aioe.orgAndrey Tarasevich <andreytarasevich@hotmail.comwrites:
....
Quote:
I got it from here
>
http://www.di-mgt.com.au/src/korn_ioccc.txt
>
I have to admit that haven't noticed that this is not really IOCCC web
site at all. Quite possibly the explanation given at that page is
incorrect.
That explanation is bogus. Originally you could omit the *type* from
the declaration (it defaulted to int) but you could not omit the complete
declaration, moreover, there should also be a keyword that made it appear
as a declaration. So:
auto unix;
was allowed (it defaulted to int), but plain:
unix;
not, and complete omission also not.

And by the time of that IOCCC omitting the type was also no longer allowed.
Quote:
It seemed pretty authentic to me and it made sense, at least
at the first sight. Now I wonder if this can actually work, given the
right OS.
The program as given (with "int unix;" added) did indeed work with Unix
on the VAX.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
  #2  
Old November 20th, 2008, 03:35 PM
Keith Thompson
Guest
 
Posts: n/a

re: Re: C ONE LINER


"Dik T. Winter" <Dik.Winter@cwi.nlwrites:
Quote:
In article <gg29j6$f40$1@aioe.orgAndrey Tarasevich
<andreytarasevich@hotmail.comwrites:
...
Quote:
I got it from here
>
http://www.di-mgt.com.au/src/korn_ioccc.txt
>
I have to admit that haven't noticed that this is not really IOCCC web
site at all. Quite possibly the explanation given at that page is
incorrect.
>
That explanation is bogus. Originally you could omit the *type* from
the declaration (it defaulted to int) but you could not omit the complete
declaration, moreover, there should also be a keyword that made it appear
as a declaration. So:
auto unix;
was allowed (it defaulted to int), but plain:
unix;
not, and complete omission also not.
Agreed.
Quote:
And by the time of that IOCCC omitting the type was also no longer allowed.
In 1987, there was no C standard, and I suspect most compilers allowed
"auto unix;" (unless they pre-defined "unix" as a macro, of course).

[...]

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python one-liner?? srinivasan srinivas answers 3 August 23rd, 2008 05:15 AM
bitwise increment one liner Mantorok Redgormor answers 8 November 14th, 2005 12:30 AM
Perl-Python-a-Day: one-liner loop Functional Style Xah Lee answers 0 October 20th, 2005 11:55 AM
One liner for extracting a number D. Alvarado answers 7 July 17th, 2005 08:55 AM
One liner for finding a file D. Alvarado answers 1 July 17th, 2005 08:50 AM