Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730011

Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files
Date 2017-09-10 18:30 +0200
Message-ID <uodho-6n2-11@gated-at.bofh.it> (permalink)
References (4 earlier) <unvgl-1Cc-17@gated-at.bofh.it> <unvT3-24G-9@gated-at.bofh.it> <unwm9-2eW-91@gated-at.bofh.it> <unzah-4ff-3@gated-at.bofh.it> <uoaWe-4xL-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Sep 10, 2017 at 6:58 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> "is_reserved_word()" sounds like a boolean function
> that returns 1 or 0.
> Maybe, the choice of the function name was not nice.

Yeah, not great name. That's the old name, though - I didn't change
that part, I just changed how it used to return the token structure
pointer, which would be NULL when it wasn't a keyword.

I actually *should* have made it just return 0 for the "not a keyword"
case rather than -1, and that would have ended up being semantically
closer to the old use (because you could treat the return value as a
boolean, like you could with the token pointer). But it's been
literally decades since I used bison/flex, and I didn't remember the
rules for 'enum yytokentype', so I just thought "negative numbers for
error" was safer. Zero would have been fine, no token can have that
number anyway (it just means EOF).

And negative wasn't safer, it caused that bug due to the bare boolean
use I hadn't noticed.

Oh well.

          Linus

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-08 08:20 +0200
  Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-08 19:30 +0200
    Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-08 20:10 +0200
      Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-08 20:40 +0200
        Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-08 23:40 +0200
          Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Sam Ravnborg <sam@ravnborg.org> - 2017-09-09 08:40 +0200
            Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-10 16:10 +0200
          Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-10 16:00 +0200
            Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of  copying _shipped files Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-10 18:30 +0200

csiph-web