Re: The Scope and Ownership of fedora-list

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

 



On Thu, 2008-08-28 at 11:09 -0500, Mike Chambers wrote:
> On Thu, 2008-08-28 at 10:32 -0500, Mike McCarty wrote:
> 
> > It's (traditional) C. Put it into a file like self-rep.c and then
> > 
> > $ gcc -o self-rep self-rep.c
> > $ ./self-rep
> > 
> > and see what happens.
> 
> [mike@scrappy ~]$ gcc -o test test.c
> test.c:1: warning: data definition has no type or storage class
> test.c:1: warning: initialization makes integer from pointer without a
> cast
> test.c: In function ‘main’:
> test.c:1: warning: incompatible implicit declaration of built-in
> function ‘printf’
> test.c:1: warning: passing argument 1 of ‘printf’ makes pointer from
> integer without a cast
> [mike@scrappy ~]$ ./test 
> p="p=%c%s%
> c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}[mike@scrappy
> ~]$ 
> 
> That's what happened when doing it on a F9 box.

A later post in the thread gets by with one warning for not #including
stdio.h, but getting it perfectly standard and portable is tough.

For one thing, the #include is required and has to be on its own line.
For another, it relies on the fact that ASCII 34 is ".

-- 
                Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux