mcinglis / c-style

My favorite C programming practices.
Other
2k stars 98 forks source link

GCC has an option preventing casting from unsigned to signed #1

Closed tiffany352 closed 11 years ago

tiffany352 commented 11 years ago

The -pedantic option will prevent many such weak casts.

mcinglis commented 11 years ago

Can you elaborate? I know that -Wsign-conversion enables warnings about implicit conversions that will change signs, but it tends to be more of a pain than necessary, and seems to encourage unsigned variables to spread (e.g. use size_t for any parameter to a calloc).