Created
December 14, 2012 14:29
-
-
Save sw17ch/4285820 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Structures */ | |
/* NO! */ | |
typedef struct foo foo_t; | |
/* YES! */ | |
struct foo; | |
/* Unions */ | |
/* NO! */ | |
typedef union foo foo_t; | |
/* YES! */ | |
union foo; | |
/* Enumerations */ | |
/* NO! */ | |
typedef enum { A, B, C } letter_t; | |
/* YES! */ | |
enum letter { A, B, C }; | |
/* typedefs */ | |
/* YESs */ | |
typedef unsigned int age_t; | |
typedef int offset_t; | |
typedef int count_t; | |
/* Yes, but only beacuse C's syntax is junk */ | |
typedef void func_ptr (void); | |
/* NO is anything other than a scalar. */ | |
/* pointers should never EVER be typedeffed for any reason at all ever */ | |
/* yes, even function pointer typedefs. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment