Advertisement
Guest User

Untitled

a guest
Jul 28th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #define SIZE_MAX 16
  2. int my_array[SIZE_MAX];
  3.  
  4. int my_array[16];
  5.  
  6. #define ARRAY_SIZE 0
  7.  
  8. int Array[ARRAY_SIZE] = {};
  9.  
  10. main.cpp:3:11: warning: zero size arrays are an extension [-Wzero-length-array]
  11. int Array[ARRAY_SIZE] = {};
  12. ^~~~~~~~~~
  13. main.cpp:1:20: note: expanded from macro 'ARRAY_SIZE'
  14. #define ARRAY_SIZE 0
  15. ^
  16. 1 warning generated.
  17.  
  18. static StringRef getImmediateMacroName(SourceLocation Loc,
  19. const SourceManager &SM,
  20. const LangOptions &LangOpts) {
  21. assert(Loc.isMacroID() && "Only reasonble to call this on macros");
  22. // Walk past macro argument expanions.
  23. while (SM.isMacroArgExpansion(Loc))
  24. Loc = SM.getImmediateExpansionRange(Loc).first;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement