From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a16aa11e8df4d689,start X-Google-Attributes: gidfee84,public From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Subject: reserved word "readonly" in DEC C Date: 1999/02/21 Message-ID: <7anks0$mju$1@node2.nodak.edu>#1/1 X-Deja-AN: 446562397 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Complaints-To: abuse@nodak.edu X-Trace: node2.nodak.edu 919557824 23166 134.129.106.23 (21 Feb 1999 00:43:44 GMT) Organization: North Dakota Higher Education Computing Network (NDHECN) Mime-Version: 1.0 NNTP-Posting-Date: 21 Feb 1999 00:43:44 GMT Newsgroups: comp.unix.osf.osf1 Is the token `readonly' a reserved word in the system C compiler under Digital Unix 4.0d? Consider the example code: #include #include struct example { int foo; int readonly; }; int main(int argc, char *argv[]) { struct example bar; bar.foo = 0; bar.readonly = 0; } If I compile with `-std1', it compiles. If I try with `-std', I get the errors: cc: Error: foo.c, line 7: Invalid declarator. int readonly; ----------------^ cc: Error: foo.c, line 15: Identifier expected but not found. bar.readonly = 0; ------------^ This leads me to believe that `readonly' is a reserved word when the compiler is in "extended" mode. Is that correct? Is this documented somewhere? Is there any way (a #pragma, perhaps) to leave the compiler in "extended" mode, but turn off the recognition of `readonly' as a token? It's causing me minor problems with some OpenSource software that uses `readonly' as a struct member in several spots. It's more work to make the code compile in strict mode than it is to actually change all references to that member to be `is_readonly', but I was just wondering if the behavior I'm seeing is expected, and/or documented. Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J1, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164