public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/53277] Warning using -Wconversion and -Ox in gcc 4.5, 4.6 and 4.7 but not in previous releases
Date: Wed, 09 May 2012 12:07:00 -0000	[thread overview]
Message-ID: <bug-53277-4-Hf6vlJQJWy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53277-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53277

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glisse at gcc dot gnu.org

--- Comment #9 from Marc Glisse <glisse at gcc dot gnu.org> 2012-05-09 11:50:09 UTC ---
glibc still has:

#   define strspn(s, accept) \
  __extension__                                                               \
  ({ char __a0, __a1, __a2;                                                   \
     (__builtin_constant_p (accept) && __string2_1bptr_p (accept)             \
      ? ((__builtin_constant_p (s) && __string2_1bptr_p (s))                  \
         ? __builtin_strspn (s, accept)                                       \
         : ((__a0 = ((const char *) (accept))[0], __a0 == '\0')               \
            ? ((void) (s), 0)                                                 \
            : ((__a1 = ((const char *) (accept))[1], __a1 == '\0')            \
               ? __strspn_c1 (s, __a0)                                        \
               : ((__a2 = ((const char *) (accept))[2], __a2 == '\0')         \
                  ? __strspn_c2 (s, __a0, __a1)                               \
                  : (((const char *) (accept))[3] == '\0'                     \
                     ? __strspn_c3 (s, __a0, __a1, __a2)                      \
                     : __builtin_strspn (s, accept))))))                      \
      : __builtin_strspn (s, accept)); })

The lone 0 in the middle should be explicitly cast to size_t, like it is for
fread_unlocked. Could you report it to glibc please?

gcc could avoid this warning when converting a constant, I am pretty sure the
same issue (possibly with another macro) already led to such a conversation...


  parent reply	other threads:[~2012-05-09 11:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08  9:00 [Bug c/53277] New: " jgpallero at gmail dot com
2012-05-08 16:06 ` [Bug c/53277] " pinskia at gcc dot gnu.org
2012-05-09 10:51 ` jgpallero at gmail dot com
2012-05-09 10:52 ` jgpallero at gmail dot com
2012-05-09 10:52 ` jgpallero at gmail dot com
2012-05-09 10:53 ` jgpallero at gmail dot com
2012-05-09 10:54 ` jgpallero at gmail dot com
2012-05-09 10:56 ` jgpallero at gmail dot com
2012-05-09 11:06 ` jgpallero at gmail dot com
2012-05-09 12:07 ` glisse at gcc dot gnu.org [this message]
2012-05-09 12:54 ` manu at gcc dot gnu.org
2012-05-09 13:11 ` jgpallero at gmail dot com
2012-05-09 13:12 ` glisse at gcc dot gnu.org
2012-05-09 13:46 ` manu at gcc dot gnu.org
2012-05-09 15:17 ` jgpallero at gmail dot com
2012-05-09 15:56 ` [Bug c/53277] -Wconversion cannot handle compound expresions manu at gcc dot gnu.org
2021-07-20 17:16 ` [Bug c/53277] -Wconversion cannot handle compound expressions me at xenu dot pl
2021-07-20 17:33 ` me at xenu dot pl
2021-07-20 17:41 ` redi at gcc dot gnu.org
2021-07-20 17:42 ` pinskia at gcc dot gnu.org
2023-06-15  0:34 ` pinskia 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-53277-4-Hf6vlJQJWy@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).