From mboxrd@z Thu Jan 1 00:00:00 1970 From: PUCCETTI Armand Subject: Re: mini-os: C programming Date: Thu, 15 Mar 2007 16:11:33 +0100 Message-ID: <45F96225.9070104@cea.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Keir Fraser a =E9crit : > On 15/3/07 13:39, "PUCCETTI Armand" wrote: > > =20 >> extern char *stack; >> =20 > > Yes, this one is bogus. > > =20 >> 2. In file xen-3.0.3/extras/mini-os/gnttab.c:140: the const variable >> gnttabop_error_msgs >> is declared as >> >> static const char *gnttabop_error_msgs[] =3D GNTTABOP_error_msgs; >> >> shouldn't that instead be declared: >> >> static const char * const gnttabop_error_msgs[] =3D GNTTABOP_error_msg= s; >> =20 > > It doesn't really matter, does it? Personally I hate scattering 'const'= all > over the place. > > -- Keir > > > =20 It doesn't cause any crash probably, but according to the semantics that = you wish gnttabop_error_msgs to have, all pointers of this array _should_ be=20 constant (I guess you're not going to change the error messages dynamically) and not only the strings refered by these pointers. The type of both=20 declarations is given by cdecl: $ cdecl char * const gnttabop_error_msgs[] ; declare gnttabop_error_msgs as array of const pointer to char; const char * gnttabop_error_msgs[]; declare gnttabop_error_msgs as array of pointer to const char;