Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mitel!sce!cognos!dy4!paul From: paul@dy4.uucp (Paul Burry) Newsgroups: comp.lang.c Subject: Were GNU C extensions proposed for the standard? Keywords: ANSI, GNU, typeof, inline, alignof Message-ID: <153@dy4.UUCP> Date: 16 Jan 90 19:27:41 GMT Reply-To: paul@dy4.UUCP (Paul Burry) Organization: DY-4 Systems Inc. Nepean, Ont Can. Lines: 62 While we're on the subject of useful extensions to C (like "typeof"), I was wondering if any of the other GNU C extensions were proposed as new features in ANSI C. Some of GNU C's more useful extensions (IMHO) are: o the addition of the "typeof" keyword o the addition of the "inline" keyword o the addition of the "alignof" keyword o statements and declarations inside of expressions ie. #define max(a,b) \ ({ \ int _a = (a); \ int _b = (b); \ _a > _b ? _a : _b; \ }) (on a side note, why didn't ANSI C define a way to avoid shadowing external variables in a macro defining?) o generalized lvalues ie. allowing expressions, compound expressions and casts as lvalues. o arrays of zero length o arrays of variable length ie. some_function(int n) { char array[n]; : } o non-constant initializers allowed for aggregates ie. foo(float f, float g) { float array[2] = { f-g, f+g }; : } o application of volatile and const to functions ie. volatile functions do not return (like exit(), abort()). const functions produce no side effects (like sin()). There are a number of other extensions, but I think that these are the most useful. If these extensions were proposed, what was the justification for denying their inclusion in the standard? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Paul Burry PHONE: (613)-596-9911 UUCP: ...!cognos!dy4!paul POST: Dy4 Systems Inc., 21 Fitzgerald Road, or ...!cognos!dy4!seu13!paul Nepean, Ontario, Canada K2H 9J4