public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/102440] Uinteger Opt/Param but the underlying type is signed
Date: Mon, 25 Oct 2021 20:53:19 +0000	[thread overview]
Message-ID: <bug-102440-4-gGXc8EsDh9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102440-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102440

--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #5)
> All right, so the meaning of the UInteger type is actually that users can't
> set the flag/param to a negative value:
> 
> $ gcc -fabi-version=-3 a.c
> gcc: error: argument to '-fabi-version=' should be a non-negative integer

That doesn't contradict using it with an "unsigned int".

> Plus there are very many flags that are initialized to -1 with Init(-1). The
> special value is used for distinguishing between a set value and the default
> one.

That doesn't contradict using it with an "unsigned int".

> So the name is unfortunate, but I don't see what can we do about it?

We could make the "UInteger" type mean it is implemented with an "unsigned int"
C type (or some other unsigned integer type).

  parent reply	other threads:[~2021-10-25 20:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  3:11 [Bug tree-optimization/102440] New: " linkw at gcc dot gnu.org
2021-09-22  3:13 ` [Bug middle-end/102440] " linkw at gcc dot gnu.org
2021-09-22  5:47 ` [Bug other/102440] " pinskia at gcc dot gnu.org
2021-09-23  6:23 ` linkw at gcc dot gnu.org
2021-09-27 13:29 ` marxin at gcc dot gnu.org
2021-10-25 15:00 ` marxin at gcc dot gnu.org
2021-10-25 20:53 ` segher at gcc dot gnu.org [this message]
2021-10-25 21:14 ` segher at gcc dot gnu.org
2021-10-26 15:17 ` marxin at gcc dot gnu.org
2021-10-26 16:45 ` segher at gcc dot gnu.org

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=bug-102440-4-gGXc8EsDh9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).