All of lore.kernel.org
 help / color / mirror / Atom feed
From: PUCCETTI Armand <armand.puccetti@cea.fr>
To: Keir Fraser <keir@xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: mini-os: C programming
Date: Thu, 15 Mar 2007 16:11:33 +0100	[thread overview]
Message-ID: <45F96225.9070104@cea.fr> (raw)
In-Reply-To: <C21F007E.B8C1%keir@xensource.com>

Keir Fraser a écrit :
> On 15/3/07 13:39, "PUCCETTI Armand" <armand.puccetti@cea.fr> wrote:
>
>   
>> extern char *stack;
>>     
>
> Yes, this one is bogus.
>
>   
>> 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[] = GNTTABOP_error_msgs;
>>
>> shouldn't that instead be declared:
>>
>> static const char * const gnttabop_error_msgs[] = GNTTABOP_error_msgs;
>>     
>
> It doesn't really matter, does it? Personally I hate scattering 'const' all
> over the place.
>
>  -- Keir
>
>
>   
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 
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 
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;

  reply	other threads:[~2007-03-15 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 13:39 mini-os: C programming PUCCETTI Armand
2007-03-15 13:54 ` Keir Fraser
2007-03-15 15:11   ` PUCCETTI Armand [this message]
2007-03-15 15:22     ` Petersson, Mats

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45F96225.9070104@cea.fr \
    --to=armand.puccetti@cea.fr \
    --cc=keir@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.