* Marcus Rueckert <[EMAIL PROTECTED]> [2007-10-17 13:37]:
> On 2007-10-17 13:32:17 +0200, Richard Guenther wrote:
> > On Wed, 17 Oct 2007, Holger Macht wrote:
> > 
> > > On Wed 17. Oct - 13:09:30, Marcus Rueckert wrote:
> > > > On 2007-10-17 12:56:51 +0200, Holger Macht wrote:
> > > > > What would result in
> > > > > 
> > > > >   char *prop = (char*)"laptop_panel.num_levels";
> > > > const char *prop = "laptop_panel.num_levels";
> > > > 
> > > > should fix it too no?
> > > 
> > > Of course it does.
> > > 
> > > I also have to change everything like:
> > > 
> > >  void testfunc(char *str);
> > >  testfunc("foo");
> > > to
> > >  testfunc((char*)"foo");
> > 
> > No, the correct fix is to make testfunc take a const char *.
> 
> and what should we do if the function is called with char* and string
> constants?

When const char * is required, you can always specify char *. But not
vice versa.


Thanks,
   Bernhard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to