avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] SIGNAL / INTERRUPT checking


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] SIGNAL / INTERRUPT checking
Date: Fri, 27 Feb 2004 15:50:27 +0100
User-agent: Mutt/1.2.5i

As Colin O'Flynn wrote:

> Would there be any interest in a program to check for legal SIGNAL /
> INTERRUPT names?

Something like:

sigcheck: $(TARGET).elf
        nm $(TARGET).elf | grep SIG_ >/dev/null && \
        echo "Warning: it is likely that there are misspelled SIG_* names"

?

:-)

Normally, all SIG_* names are supposed to be resolved into _vector_N
names by the preprocessor magic.  So if any SIG_ survived into the
output symbol table, that is most likely the programmer's fault.

Of course, the programmer could legally use constructs like

int SIG_FOO_ARRIVED;

which will be mistaken by the above simple grep command as well,
that's why I made the message a bit vague.  A check using awk could be
more sophisticated here, and verify the SIG_* names are actually
referring to functions.

I hope the >/dev/null redirection also works in the WinAVR (MinSYS?)
environment.  Otherwise, as long as you've got GNU grep (or 4.4BSD
grep), you can replace it by »grep -q«, but that is not portable to
older Unix grep utilities.

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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