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

            Bug ID: 66008
           Summary: "section type conflict" if calling a macro inlined or
                    in a two times derived class
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dgdanielf at gmail dot com
  Target Milestone: ---

I get a "section type conflict" if I call the macro below in an inlined
function. There is nothing which can be found about this error in the WWW.

The intention of the macro is to offer a macro to deal with strings saved in
the flash for Arduino (just a side info). If the function is not inlined
everything compiles fine. 

If I call this macro in a one time derived class it compiles as well.
If I call it in a two times derived class again this problem :D


Macro: 

#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))

#undef PSTR
/* need to define prog_char in avr-gcc 4.7 */
#if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR__ > 6
typedef char prog_char;
#endif
/* Need const type for progmem - new for avr-gcc 4.6 */
#if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR__ > 5
#define PSTR(s) (__extension__({static const prog_char __c[] PROGMEM = (s); \
                                  (const prog_char_t *)&__c[0]; }))
#else
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); \
                                  (prog_char_t *)&__c[0]; }))
#endif

I put it with a demo on stackoverflow.
http://stackoverflow.com/questions/30032468/section-type-conflict-due-to-macro-definition-in-gcc-4-8-2

Reply via email to