[gccsdk] Patch for getgrouplist() and ELF questions

John Tytgat John.Tytgat at aaug.net
Mon Dec 15 13:26:25 PST 2008


In message <49458E33.9060301 at gmx.co.uk>
          Alex Macfarlane Smith <archifishal at gmx.co.uk> wrote:

> Theo Markettos wrote:
> > On Sat, Dec 06, 2008 at 04:20:45PM +0200, John Tytgat wrote:
> >> In message <20081204215433.GA19708 at chiark.greenend.org.uk>
> >>           Theo Markettos <theo at markettos.org.uk> wrote:
> >>
> >>> +  while ((grp = getgrent ()) !=NULL)
> >>> +    {
> >>> +      char **mem;
> >> const char ** would be slightly better.
> > 
> > That doesn't work, because we have to modify the value of mem.
> 
> I thought const char ** meant a pointer to a pointer to a const char, so 
> that doesn't negate the possibility of changing mem.
> 
> I think char * const * mem; would be that...
> 
> Or I may be talking gibberish :)

You're right Alex and actually I had the same first reaction but what Theo
probably meant was that with "const char **mem" you'll end up with a 
warning for 'incompatible pointer' when you assign mem with a 'char **'
value.  So it wasn't a good suggestion after all.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven




More information about the gcc mailing list