From: Philippe Gerum <rpm@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Signature of kernel_init of xenomai-solo?
Date: Mon, 22 Sep 2008 19:50:12 +0200 [thread overview]
Message-ID: <48D7DAD4.4070304@domain.hid> (raw)
In-Reply-To: <48D5672E.6000006@domain.hid>
Gilles Chanteperdrix wrote:
> Niklaus Giger wrote:
>> Hi
>> Shouldn't the signature not bee
>> STATUS kernelInit(FUNCPTR rootRtn, int argc, const char * argv[]);
>> instead of
>> STATUS kernelInit(FUNCPTR rootRtn, int argc, char *const argv[]);
>> I think this would be more like a classical definition "main".
>>
>> I have a classical definition of
>> int main(int argc, char *argv[])
>> which permits mit to pass it to , const char * argv[]),
>> whereas char *const argv[] is not an allowd cast.
>
> Personnaly, I always used:
>
> int main(int argc, const char *const argv[])
>
> until the day when I started using getopt or getopt_long, which
> prototype are:
>
> int getopt(int argc, char * const argv[],
> const char *optstring);
> int getopt_long(int argc, char * const argv[],
> const char *optstring,
> const struct option *longopts, int *longindex);
>
> So, now, I always use:
>
> int main(int argc, char *const argv[])
>
> Maybe that is also the reason for the prototype of kernelInit ?
>
Yes it is. Even if that looks a bit funky, we are still supposed to be able to
poke to the arg memory, even if we can't change the pointers to it.
--
Philippe.
prev parent reply other threads:[~2008-09-22 17:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-19 18:47 [Xenomai-core] Signature of kernel_init of xenomai-solo? Niklaus Giger
2008-09-20 21:12 ` Gilles Chanteperdrix
2008-09-22 17:50 ` Philippe Gerum [this message]
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=48D7DAD4.4070304@domain.hid \
--to=rpm@xenomai.org \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@xenomai.org \
/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.