From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp,comp.lang.c Subject: Re: Warning : if (x=y) Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 35 X-Trace: /bNDCymmm6IagdvsanMadMaQV3u9jqAwaT/m7uGLI7hKkvu3zdbvcTveBXaAMrR4MOlKcHXZT00e!kqvJ+38weCRTXBew+7fCRjffw3g92T4rqvNOC0iSJET5FPWaZig4ZlzAyCn2bX7NcVhCSLPh87q/!f9n+9e0= X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Wed, 13 Sep 2000 01:36:48 GMT Distribution: world Date: Wed, 13 Sep 2000 01:36:48 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Wed, 13 Sep 2000 00:48:21 +0100, Jason Green wrote: >Andris Pavenis wrote: > >> With gcc-2.95.2 -fpedantic-errors is default for C++ ... > >Unless you compile the following as C++ code: > >int main(void) >{ > char s1[4], s2[4] = "foo"; > > s1 = s2; /* illegal */ > > return 0; >} > >I don't know if this is bug or feature [in GCC]. Feature. AFAIK an array name is not an lvalue. You can, OTOH, say char *s1; char *s2[4] = "bar"; s1 = s2; comp.lang.c added for a full explanation of this language issue. -- MS (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease, multiple sclerosis (see). This is McAfee VirusScan. Add these two lines to your signature to prevent the spread of signature viruses. http://www.mcafee.com/