Article View: gnu.gcc.help
Article #53567Re: arrays of pointers and "incompatible pointer" warnings
From: Bob Davis
Date: Tue, 29 Oct 1991 20:39
Date: Tue, 29 Oct 1991 20:39
28 lines
1990 bytes
1990 bytes
> Date: Tue, 29 Oct 91 21:23:05 +0100 > From: Richard M Stallman <rms@dist.dist.unige.it> > Reply-To: rms@gnu.ai.mit.edu > > about incompatible pointer types. > > lala.c: In function a_function: > > lala.c:13: warning: argument passing between incompatible pointer types > > Removing const makes the pointers compatible -- implying that > const char *[] is incompatible with char **. This seems wrong, > > GCC is following ANSI C, which says that these types aren't compatible. > In this case, I don't think anything is really wrong with the code. > But you can avoid the warning by adding a cast, and I think that's > a simple enough option, so there's no problem with how things are now. Well, if this is standard behavior, I can understand it working this way. But that doesn't mean I have to like it! It also doesn't seem consistent (at first glance) with the usual tolerance of passing non-const items as actual args for parameters declared const. If this is indeed yet another user hostile ANSI "feature", perhaps we can make the gnu compiler act in a more accomodating fashion (wrt warnings about this), except when using the -ansi option. That's probably the most desirable behavior I could think of here. It is certainly true that this is not a big problem, like some other brain damage, such as trigraphs. Anyhow, thanks for checking it out.
Technical Details
Message-ID:
<9110292039.AA21603@mighty>Path:
arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!viewlogic.COM!bobdavisShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,cfce2e2da9583e5 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1991-10-29 13:43:30 PST Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!viewlogic.COM!bobdavis From: bobdavis@viewlogic.COM (Bob Davis) Newsgroups: gnu.gcc.help Subject: Re: arrays of pointers and "incompatible pointer" warnings Message-ID: <9110292039.AA21603@mighty> Date: 29 Oct 91 20:39:11 GMT Sender: daemon@cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 28