[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [patch] give gpioctl.c some love
Am 22.08.2015 um 10:15 schrieb Marc Balmer:
Imo, this patch does not solve a problem, but creates new ones, maybe...
The constness that you sprinkle is definitely not needed, only makes
the code cluttered imo.
This "constness" is mainly adding "pointers to const" in function
arguments and for strings. Some will consider this good style to say the
least (MISRA, CERT C Coding Standard), and some even claim it will allow
for better compiler optimization.
CERT has for example:
DCL00-C. Const-qualify immutable objects
DCL13-C. Declare function parameters that are pointers to values not
changed by the function as const
STR05-C. Use pointers to const when referring to string literals
STR30-C. Do not attempt to modify string literals
Main Index |
Thread Index |