[Tfug] Felix the Screwup

Tim Ottinger tottinge at gmail.com
Mon Sep 10 11:34:27 MST 2007


Yep. An expression is a statement. If you can evaluate it, it's a
non-warning. That's partly because side effects can BE the program. It's a
somewhat crummy language that way.   OTOH, I can do a similar thing in
Python, so I'm not too harsh on K&R.




On 9/10/07, jblais <joe.blais at pti-instruments.com> wrote:
>
> Hello -
>
> I think "sync ;" is a pointer to function, "sync() ;" is calling that
> function being pointed to.
>
> Being a pointer, it's a lot like any other declared variable.  It can be
> part of an expression.  "sync ;" is kind of a no-op expression.  You don't
> need to make an assignment in an expression.  You probably won't get an
> error with code like this either:  "int iI ; iI ; ++iI ;"   no assignments
> in any of them, other than allocating space (you could say assigning
> address
> value to iI, and ++iI which increments the value of whatever is in iI.
> No warning, no errors, doesn't do anything either.
>
> joe
>
> > -----Original Message-----
> > From: tfug-bounces at tfug.org [mailto:tfug-bounces at tfug.org]On Behalf Of
> > Felix Tilley
> > Sent: Sunday, September 09, 2007 9:49 PM
> > To: Tucson Free Unix Group
> > Subject: [Tfug] Felix the Screwup
> >
> >
> > I am self taught in C.  My only formal language training was in PDP-11
> > assembly language, circa 1983, at Hughes in Canoga Park.
> >
> >
> >
> > sync();        /* Force I/O to disk */
> >
> >
> > exit (0);
> >
> >
> > On my first try. I used
> >
> >
> > sync;        /* Force I/O to disk */
> >
> >
> > exit (0);
> >
> >
> > Note lack of parentheses on the first try.  No errors, no warnings.  It
> > just compiled.
> > I am not aware of a sync command in C.  I didn't figure it out until I
> > compiled with the -S option, and examined the assembly text.
> >
> > Sorry to have left early on Thursday.  I had rocket ship diarrhea.
> > That's where you hold on to the toilet seat to stay out of orbit.
> >
> > gcc --version
> > gcc (GCC) 4.1.0 (SUSE Linux)
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Tucson Free Unix Group - tfug at tfug.org
> > Subscription Options:
> > http://www.tfug.org/mailman/listinfo/tfug_tfug.org
> >
> >
>
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>



More information about the tfug mailing list