[riot-notifications] [RIOT] Replace all numeric constants by macros (#136)

kaspar030 notifications at github.com
Wed Aug 14 16:12:37 CEST 2013


Just had a case where gcc would evaluate this as false:
```
#define SOMETHING 0xFF
char i = 0xFF
if (i == SOMETHING) ...
```

had to explicitly cast:
```if (i == (char)SOMETHING)``` to get the desired result.

Macros are evil. Can enums be used in the same way as constant macros?
What about "static const int i = <constant>"?

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/136#issuecomment-22638221
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20130814/bd1eab46/attachment-0001.html>


More information about the notifications mailing list