avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] __attribute__((naked)) with C code


From: Joseph Sible
Subject: [avr-gcc-list] __attribute__((naked)) with C code
Date: Fri, 2 Jun 2017 21:27:41 -0400

I notice that GCC's documentation [1] says "Only basic asm statements
can safely be included in naked functions (see Basic Asm). While using
extended asm or a mixture of basic asm and C code may appear to work,
they cannot be depended upon to work reliably and are not supported."
However, a lot of our example code contains naked functions with C
code, such as [2], [3], and [4], as well as indirectly via ISR_NAKED,
such as [5] and [6]. Is there a reason that GCC's documentation
doesn't apply to us here, or is it only by sheer luck that none of
these have resulted in problems in practice?

[1] https://gcc.gnu.org/onlinedocs/gcc/AVR-Function-Attributes.html
[2] http://www.nongnu.org/avr-libc/user-manual/mem_sections.html#c_sections
[3] http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_softreset
[4] http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html#details
[5] 
http://www.nongnu.org/avr-libc/user-manual/group__avr__time.html#ga15aea81a8985a4c3cc9c8b00a06f5d31
[6] 
http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html#attr_interrupt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]