Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!oliveb!pyramid!prls!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.lang.c Subject: Re: Disregarding parentheses in C Message-ID: <762@mcgill-vision.UUCP> Date: Thu, 7-May-87 04:34:01 EDT Article-I.D.: mcgill-v.762 Posted: Thu May 7 04:34:01 1987 Date-Received: Thu, 14-May-87 01:33:06 EDT References: <200@m10ux.UUCP> <6378@mimsy.UUCP> <1038@wanginst.EDU> Organization: McGill University, Montreal Lines: 31 Keywords: C parentheses evaluation order parsing In article <1038@wanginst.EDU>, mckeeman@wanginst.EDU (William McKeeman) writes: > [begin of quote of x3j11 document July 9, 1986, available from > Computer and Business Equipment Manufacturers Association, 311 First > Street, N.W., Suite 500, Washington, DC 20001-2178. (202)737-8888] > 3.3 EXPRESSIONS [...] > An expression [...] may be regrouped [...], provided the types of the > operands or of the results are not changed by this regrouping. [...] > [end of quote] > [begin comment by McKeeman] > The only constraint on compiler rearrangements is that the TYPE of > the operands and results not thereby be changed. (emphasis mine) Does this mean that after extern char _ctypes_[]; #define _ctypes (_ctypes_+1) /* so _ctypes[EOF] is ok */ the compiler is not permitted to change _ctypes['x'] into _ctypes_['y'] because (_ctypes_+1)['x'] <-> *((_ctypes_+1)+'x') cannot be transformed into *(_ctypes_+(1+'x')) <-> _ctypes_[1+'x']? (Yes, I realize that in the example above the entire subscripting operation would (hopefully) computed at compile time. It was intended to illustrate a point.) der Mouse (mouse@mcgill-vision.uucp)