public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/27885] New: _Static_assert fallback definition in <sys/cdefs.h> triggers a lgtm.com alert
@ 2021-05-18 12:28 gjover at sipwise dot com
  2023-07-03  1:53 ` [Bug libc/27885] " ppluzhnikov at google dot com
  0 siblings, 1 reply; 2+ messages in thread
From: gjover at sipwise dot com @ 2021-05-18 12:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27885

            Bug ID: 27885
           Summary: _Static_assert fallback definition in <sys/cdefs.h>
                    triggers a lgtm.com alert
           Product: glibc
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: gjover at sipwise dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

The fallback definition for _Static_assert in <sys/cdefs.h>, which is currently
(as of git HEAD glibc-2.33.9000-613-g4d4bb451d5f):

  #if (!defined _Static_assert && !defined __cplusplus \
       && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
       && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
  # define _Static_assert(expr, diagnostic) \
      extern int (*__Static_assert_function (void)) \
        [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
  #endif

causes the lgtm.com analyzer to trigger, on code using that keyword, the
following alert:

  https://lgtm.com/rules/1506024027114/

which is described as:

  Ambiguously signed bit-field member

  Bit fields with integral types should have explicit signedness only. For 
  example, use `unsigned int` rather than `int`. It is implementation specific 
  whether an `int`-typed bit field is signed, so there could be unexpected sign 
  extension or overflow.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libc/27885] _Static_assert fallback definition in <sys/cdefs.h> triggers a lgtm.com alert
  2021-05-18 12:28 [Bug libc/27885] New: _Static_assert fallback definition in <sys/cdefs.h> triggers a lgtm.com alert gjover at sipwise dot com
@ 2023-07-03  1:53 ` ppluzhnikov at google dot com
  0 siblings, 0 replies; 2+ messages in thread
From: ppluzhnikov at google dot com @ 2023-07-03  1:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27885

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-07-03
             Status|UNCONFIRMED                 |NEW
                 CC|                            |ppluzhnikov at google dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-03  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 12:28 [Bug libc/27885] New: _Static_assert fallback definition in <sys/cdefs.h> triggers a lgtm.com alert gjover at sipwise dot com
2023-07-03  1:53 ` [Bug libc/27885] " ppluzhnikov at google dot com

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).