[Tfug] Felix the Screwup

jblais joe.blais at pti-instruments.com
Mon Sep 10 10:09:00 MST 2007


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
>
>





More information about the tfug mailing list