bugAVR C Runtime Library - Bugs: bug #8643, Misspelled signal names are not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8643: Misspelled signal names are not caught by gcc.

Submitter:  Theodore A. Roth <troth>
Submitted:  Wed 21 Apr 2004 04:51:38 PM UTC
   
 
Category:  Header Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  troth
Percent Complete:  0% Open/Closed:  Closed
Release:  None Fixed Release:  None

Mon 29 Nov 2004 04:19:39 AM UTC, comment #2: 

Marek has committed my patch for gcc.

GCC >= 4.0 will now generate a warning if a function has either the "interrupt" or "signal" attribute and the name of the function does not start with "__vector".

Theodore A. Roth <troth>
Wed 12 May 2004 07:49:46 PM UTC, comment #1: 

After a bit more thought, I don't really like doing all this magic in the headers to try to catch the problem.

It was actually fairly trivial to teach gcc how to catch this. I've attached a patch for gcc. If it is acceptable, I'll send it upstream to Marek for his comments.

Theodore A. Roth <troth>
Wed 21 Apr 2004 04:51:38 PM UTC, original submission:  

When using the SIGNAL() and INTERRUPT() macros, there is currently no way for gcc to catch when the signal name (the SIG_* defines in the io*.h files) is misspelled. This is a long standing problem.

The core of the problem is that avr-libc defines macros which reference the SIG_* defines to generate special function declarations. These declarations are what lets gcc know that it should generate an interrupt handler function and in turn allows the linker to place a reference to the handler in the interrupt vector table.

When the SIG_* is misspelled in the arg to SIGNAL(), gcc will not give any indication of the mistake, but will just compile it as a regular function and the interrupt vector table will not jump into the handler.

Some possible solutions have been discussed in this thread:

http://mail.gnu.org/archive/html/avr-libc-dev/2004-04/msg00072.html

I'm going to attached the submitted patches to the report so that they don't slip through the cracks.

Theodore A. Roth <troth>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #1304:  gcc-avr-misspelled-sig-1.diff added by troth (2KiB - text/x-patch - Patch for gcc to generate a warning if the vector name appears to be misspelled.)
file #1246:  avr-libc-misspeeled-sig-5.diff added by troth (6KiB - text/plain - Fix copy/paste error when defining EMPTY_INTERRUPT().)
file #1230:  avr-libc-misspeeled-sig-4.diff added by troth (6KiB - text/plain - Updated version of Dmitry's patch.)
file #1229:  avr-libc-misspeeled-sig-3-dmitry.diff added by troth (5KiB - text/plain - Dmitry's proposed patch.)
file #1228:  avr-libc-misspeeled-sig-2.diff added by troth (8KiB - text/plain - Updated to fix some asm problems.)
file #1227:  avr-libc-misspeeled-sig.diff added by troth (7KiB - text/plain - First proposed patch.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 12 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-11-29 troth StatusNone Fixed
    Open/ClosedOpen Closed
2004-05-12 troth Attached File- Added gcc-avr-misspelled-sig-1.diff, #1296
2004-04-23 troth Attached File#1229 Removed
2004-04-23 troth Attached File- Added avr-libc-misspeeled-sig-5.diff, #1230
2004-04-23 troth Attached File- Added avr-libc-misspeeled-sig-5.diff, #1229
2004-04-21 troth Attached File- Added avr-libc-misspeeled-sig-4.diff, #1214
2004-04-21 troth Attached File#1213 Removed
2004-04-21 troth Attached File- Added avr-libc-misspeeled-sig-3-dmitry.diff, #1213
2004-04-21 troth Attached File- Added avr-libc-misspeeled-sig-3-dmitry.diff, #1212
2004-04-21 troth Attached File- Added avr-libc-misspeeled-sig-2.diff, #1211
2004-04-21 troth Attached File- Added avr-libc-misspeeled-sig.diff, #1210

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code