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

            Bug ID: 67352
           Summary: [avr] incorrect warning with -Waddr-space-convert and
                    array in struct in __flash
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Keywords: addr-space, diagnostic
          Severity: normal
          Priority: P3
         Component: target
          Assignee: gjl at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---
            Target: avr

== C source ==

typedef struct
{
    char a, b[3];
} S;

const __flash char* get_b1 (const __flash S *s)
{
   return s->b;
}

extern const __flash S ab;

const __flash char* get_b2 (void)
{
   return ab.b;
}

== Command line ==

$ avr-gcc -mmcu=atmega8 main.c -Werror=addr-space-convert -fsyntax-only


== avr-gcc Output ==

main.c: In function 'get_b1':
main.c:8:4: error: conversion from address space 'generic' to address space
'__flash' [-Werror=addr-space-convert]

main.c: In function 'get_b2':
main.c:15:4: error: conversion from address space 'generic' to address space
'__flash' [-Werror=addr-space-convert]

Reply via email to