[eepro100] Fix for compile time error: kern_compat.h:164: parse error before `0'

Rowdy peter.renner@gmx.net
Sun, 29 Oct 2000 13:57:15 +0100


To whom it may concern:

After installing pci-scan.c pci-scan.h kern_compat.h and together with the new (v1.11) eepro100.c in /usr/src/linux/drivers/net, i got an error doing make modules using gcc
(--version => 2.95.2):

In file included from eepro100.c:127:
kern_compat.h:164: parse error before `0'
kern_compat.h:168: warning: type defaults to `int' in declaration of `mark_bh'
kern_compat.h:168: warning: parameter names (without types) in function declaration
kern_compat.h:168: conflicting types for `mark_bh'
/usr/src/linux/include/asm/softirq.h:101: previous declaration of `mark_bh'
kern_compat.h:168: warning: data definition has no type or storage class
kern_compat.h:168: parse error before `}'
gcc: Internal compiler error: program cc1 got fatal signal 11

Solution:

locate the following lines at the end of  kern_compat.h


163: #define netif_pause_tx_queue(dev) \
164:     (test_and_set_bit(0, (void*)&(dev)->tbusy))
165: #define netif_unpause_tx_queue(dev) \
166:     do { clear_bit(0, (void*)&(dev)->tbusy); } while (0)
167: #define netif_resume_tx_queue(dev) \
168:     do { clear_bit(0, (void*)&(dev)->tbusy); mark_bh(NET_BH); } while (0)
169: #endif
170:
171: #endif

while line 164ff look perfectly right, the error messages were fixed after i changed the ones with the line continuation back slash to look like this:

163: #define netif_pause_tx_queue(dev)  (test_and_set_bit(0, (void*)&(dev)->tbusy))
164: #define netif_unpause_tx_queue(dev) do { clear_bit(0, (void*)&(dev)->tbusy); } while (0)
165: #define netif_resume_tx_queue(dev)  do { clear_bit(0, (void*)&(dev)->tbusy); mark_bh(NET_BH); } while (0)
166: #endif
167:
168: #endif

e.g. remove the `\' at the lines' end and join the subsequent one. (Be careful when reading this on the list as line truncation might have it appear different, that's why i
did give line numbers, too. Should you wonder why there are no line numbers in your kern_compat.h in the first place, please get some C programmer to assist you ;)

Someone please update ftp://scyld.com/pub/network/kern_compat.h and notify the gcc maintainers (or is my SuSE 7.0 gcc already outdated?)



have phun

Peter Renner, eepro100@zihle.com

P.S: please do comment vigoursly in case i goofed up something!
Up to now i managed to screw up almost everytime i proudly tried to contribute to The Developers' Communtiy. (must be the excitement ;)