Newsgroups: comp.std.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: ANSI vs K&R 3.7.1 structures Help! Message-ID: <1991Mar23.234602.11872@zoo.toronto.edu> Date: Sat, 23 Mar 1991 23:46:02 GMT References: <1991Mar22.183721.11779@world.std.com> Organization: U of Toronto Zoology 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@zoo.toronto.edu utzoo!henry