Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Question on const applied to typedef'd pointer Message-ID: <9709@smoke.BRL.MIL> Date: 25 Feb 89 05:25:01 GMT References: <9078@elsie.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <9078@elsie.UUCP> ado@elsie.UUCP (Arthur David Olson) writes: >1> const char * const foo; > typedef char * bar; >2> const bar const baz; >The question for the gurus: should line 1 above have the same meaning as >line 2 above, despite gcc's warning? No; you can't slip a qualifier "inside" an existing typedef. GCC is correct; both "consts" apply at the same lexical level, namely to the "bar" type. The line tagged "2>" above is the same as char * const const foo;