fork(5) download
  1. #include <cstdint>
  2.  
  3. static uint16_t MAGIC_NUMBER_VAL = 7076;
  4.  
  5. #define convert_func(NUM) hexify(NUM)
  6. #define hexify(NUM) 0x ## NUM
  7.  
  8. static const uint16_t val = convert_func(MAGIC_NUMBER_VAL); //0x7076
  9. static const uint16_t val_tag = MAGIC_NUMBER_VAL;
  10.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:21: error: unable to find numeric literal operator ‘operator""xMAGIC_NUMBER_VAL’
 #define hexify(NUM) 0x ## NUM
                     ^~
prog.cpp:5:27: note: in expansion of macro ‘hexify’
 #define convert_func(NUM) hexify(NUM)
                           ^~~~~~
prog.cpp:8:29: note: in expansion of macro ‘convert_func’
 static const uint16_t val = convert_func(MAGIC_NUMBER_VAL); //0x7076
                             ^~~~~~~~~~~~
stdout
Standard output is empty