PolicyKit oddities

Scott James Remnant scott at canonical.com
Mon Jun 9 15:34:22 PDT 2008


On Mon, 2008-06-09 at 15:46 +0300, David Weinehall wrote:

> On fre, 2008-06-06 at 16:54 +0100, ext Scott James Remnant wrote: 
> > On Fri, 2008-06-06 at 09:35 -0400, David Zeuthen wrote:
> > 
> > > Probably even const * char *
> > > 
> > Except that in C, const * char * is not compatible with char ** -- you
> > can only add one layer of const.
> > 
> > The usual promise idiom for a char ** you don't plan to modify is
> > char * const *.  It's not "const enough" to really guarantee you won't
> > modify it, but it makes gcc happy.
> 
> Hmmm, gcc-4.3 doesn't seem to complain about
> 
> "const char *const *const"
> 
Err, you can't assign to one of those ;)

wing-commander scott% cat a.c
int main () {
	char **a;
	const char * const *b;

	b = a;

	return 0;

}
wing-commander scott% gcc -Wall -Wextra -pedantic -ansi a.c
a.c: In function ‘main’:
a.c:5: warning: assignment from incompatible pointer type

wing-commander scott% gcc --version
gcc (Ubuntu 4.3.0-5ubuntu1) 4.3.1 20080525 (prerelease)


Scott
-- 
Scott James Remnant
scott at canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/hal/attachments/20080609/ee0f62d3/attachment.pgp 


More information about the hal mailing list