public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100920] New: bogus warn on -Wscalar-storage-order
@ 2021-06-04 23:09 george.thopas at gmail dot com
  2021-06-05 14:31 ` [Bug c/100920] " ebotcazou at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: george.thopas at gmail dot com @ 2021-06-04 23:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100920
           Summary: bogus warn on -Wscalar-storage-order
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: george.thopas at gmail dot com
  Target Milestone: ---

/* 
 * trying to use -Wscalar-storage-order on latest git version
 *
 * https://gcc.gnu.org/g:401bd4adcfda9965363b1ac3ba7e1580f15d6883
 *
 * below test exposes what looks like 2 wrong warnings  
 * a warning on an union where everything is big-endian 
 * a warning on type less void pointer
 *
 * gcc -Werror test.c
 *   
 * Thanks
 */
include <stddef.h>

struct s_1 {
    int val;
} __attribute__((scalar_storage_order("big-endian")));

typedef struct s_1 t_1;

struct s_2 {
    char val;
} __attribute__((scalar_storage_order("big-endian")));

typedef struct s_2 t_2;

struct s12 {
    t_1 a[1];
    t_2 b[1]; 
} __attribute__((scalar_storage_order("big-endian")));

typedef struct s12 t_s12;

/* Warning while everything is big-endian */
union u12 {
    t_1 a[1];
    t_2 b[1];
} __attribute__((scalar_storage_order("big-endian")));

typedef union u12 t_u12;

int main(void)
{
    /* warning while assigning from a type less void pointer */
    t_s12 *msg1 = __builtin_alloca(10);
    t_u12 *msg2 = __builtin_alloca(10);
    msg1->a[0].val=0;
    msg2->a[0].val=0;
    return 0;

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

end of thread, other threads:[~2021-06-09 10:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 23:09 [Bug c/100920] New: bogus warn on -Wscalar-storage-order george.thopas at gmail dot com
2021-06-05 14:31 ` [Bug c/100920] " ebotcazou at gcc dot gnu.org
2021-06-05 14:32 ` [Bug c/100920] bogus warnings with -Wscalar-storage-order ebotcazou at gcc dot gnu.org
2021-06-05 17:53 ` george.thopas at gmail dot com
2021-06-05 19:13 ` ebotcazou at gcc dot gnu.org
2021-06-06  9:43 ` cvs-commit at gcc dot gnu.org
2021-06-06  9:44 ` ebotcazou at gcc dot gnu.org
2021-06-07 11:55 ` george.thopas at gmail dot com
2021-06-07 16:14 ` ebotcazou at gcc dot gnu.org
2021-06-07 16:23 ` cvs-commit at gcc dot gnu.org
2021-06-08 12:24 ` george.thopas at gmail dot com
2021-06-08 15:54 ` ebotcazou at gcc dot gnu.org
2021-06-09 10:40 ` cvs-commit at gcc dot gnu.org

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