All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Francis Moreau <francis.moro@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: memparse(), simple_strtoul() prototypes...
Date: Sun, 18 Feb 2007 16:30:48 -0800	[thread overview]
Message-ID: <45D8EFB8.4050805@zytor.com> (raw)
In-Reply-To: <38b2ab8a0702180804l26d99a01y558bce2ee964d973@mail.gmail.com>

Francis Moreau wrote:
> Hi,
> 
> I must miss something...
> 
> Looking at these prototypes
> 
> unsigned long simple_strtoul(const char *cp, char **endp,unsigned int base)
> unsigned long long memparse (char *ptr, char **retptr)
> 
> I'm really wondering why not all parameters are not all 'const'. None
> of these functions modify any pointer containts. And simple_strtoul()
> ends up doing sometghing like:
> 
> if (endp)
>         *endp = (char *)cp;
> 
> Could anyone shed some light ?

The C standard behaves like that, too, mostly because C doesn't have a 
way to say "X is const iff Y is const" (unlike C++, btw.)

	-hpa

  reply	other threads:[~2007-02-19  0:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 16:04 memparse(), simple_strtoul() prototypes Francis Moreau
2007-02-19  0:30 ` H. Peter Anvin [this message]
2007-02-19 13:03   ` Francis Moreau
2007-02-19 14:05     ` Avi Kivity
2007-02-20  8:19       ` Francis Moreau

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=45D8EFB8.4050805@zytor.com \
    --to=hpa@zytor.com \
    --cc=francis.moro@gmail.com \
    --cc=linux-kernel@vger.kernel.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.