ANSI vs K&R 3.7.1 structures Help!

Henry Spencer henry at zoo.toronto.edu
Sun Mar 24 09:46:02 AEST 1991


You do not specify where the troublesome declarations were, and that is
crucial.  Context indicates they were within a function, but it matters
a lot whether they were in the parameter list or inside the {}.  The rule
quoted from 3.7.1 really does constrain parameter-list declarations to
contain at least one declarator.  No such constraint applies to declarations
within the function body.

Many older compilers were looser about what they allowed in parameter lists.
Argument by example is always unreliable, and is especially so for C, because
many superfically-different C compilers have common ancestry.

>    ... One thing that really wories me is that they say
>    the 'stuct defs' tag  has  been  given file scope.  It was declared
>    INSIDE the function!  I thought that this made it local not global.

Now *this* sounds seriously bogus.  Struct tags obey the same scope rules
as other declared identifiers.
-- 
"[Some people] positively *wish* to     | Henry Spencer @ U of Toronto Zoology
believe ill of the modern world."-R.Peto|  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.std.c mailing list