mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Francis Moreau" <francis.moro@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: memparse(), simple_strtoul() prototypes...
Date: Mon, 19 Feb 2007 14:03:13 +0100	[thread overview]
Message-ID: <38b2ab8a0702190503n32caeab3j2c2139c71cb5a9c5@mail.gmail.com> (raw)
In-Reply-To: <45D8EFB8.4050805@zytor.com>

Hi,

On 2/19/07, H. Peter Anvin <hpa@zytor.com> wrote:
> 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.)
>

hm, I don't get your point. I understand why we cast 'cp' into a (char
*) but that's not my point. My point is why aren't all function
parameters are not const ?

-- 
Francis

  reply	other threads:[~2007-02-19 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 16:04 Francis Moreau
2007-02-19  0:30 ` H. Peter Anvin
2007-02-19 13:03   ` Francis Moreau [this message]
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=38b2ab8a0702190503n32caeab3j2c2139c71cb5a9c5@mail.gmail.com \
    --to=francis.moro@gmail.com \
    --cc=hpa@zytor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®