Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Ike Naar <ike@sverige.freeshell.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Need some info on const char ** |
| Date | 2011-04-29 09:13 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrn3vfsirl08v.nnt.ike@sverige.freeshell.org> (permalink) |
| References | (2 earlier) <7h5fr6p7g8pgdaeohia1dlumnl7tha9nlk@4ax.com> <91q0l9Fne0U1@mid.uni-berlin.de> <keahr61pvtnftn6vhtppsva2v51a3t7b0e@4ax.com> <slrn3vfsiri28s.hn3.ike@iceland.freeshell.org> <buikr6p8nu92pv0nfi215sbdesj58crflm@4ax.com> |
On 2011-04-29, DSF <notavalid@address.here> wrote:
>>Perhaps you are compiling your code as C++?
> No. May I ask what led to that question?
The remark that the compiler did not complain. Consider
/* ex.c */
void foo(char const * const *s);
void bar(char **s) { foo(s); }
In C, the types in the call to foo() are incompatible and the compiler
must produce a diagnostic. Using gcc 4.1.2:
$ cc -ansi -Wall -pedantic -c ex.c
ex.c:2: warning: passing argument 1 of 'foo' from incompatible pointer type
In C++ the types are compatible and no diagnostic is produced:
$ c++ -Wall -pedantic -c ex.c
There's an item about this issue in the C FAQ:
http://c-faq.com/ansi/constmismatch.html
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Need some info on const char ** DSF <notavalid@address.here> - 2011-04-26 18:49 -0500
Re: Need some info on const char ** jt@toerring.de (Jens Thoms Toerring) - 2011-04-27 00:10 +0000
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-04-27 00:38 -0500
Re: Need some info on const char ** jt@toerring.de (Jens Thoms Toerring) - 2011-04-27 07:58 +0000
Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-27 15:41 +0100
Re: Need some info on const char ** lawrence.jones@siemens.com - 2011-04-27 14:42 -0400
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-04-27 19:19 -0500
Re: Need some info on const char ** Ike Naar <ike@iceland.freeshell.org> - 2011-04-28 06:28 +0000
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-04-29 00:47 -0500
Re: Need some info on const char ** Ike Naar <ike@sverige.freeshell.org> - 2011-04-29 09:13 +0000
Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-29 16:08 +0100
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-03 01:47 -0500
Re: Need some info on const char ** Ike Naar <ike@otaku.freeshell.org> - 2011-05-03 07:45 +0000
Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-03 11:55 +0100
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-04 20:20 -0500
Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-05 02:57 +0100
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-07 22:03 -0500
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-04 19:53 -0500
Re: Need some info on const char ** falk@rahul.net (Edward A. Falk) - 2011-05-05 02:01 +0000
Re: Need some info on const char ** Ike Naar <ike@sverige.freeshell.org> - 2011-05-05 05:51 +0000
Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-07 22:04 -0500
Re: Need some info on const char ** Paul N <gw7rib@aol.com> - 2011-04-27 14:03 -0700
csiph-web