some1 (some41) wrote,
some1
some41

C++11 gotcha

#include <stdio.h>

#define SIZET_FMT "z"

int main() {
    printf("%"SIZET_FMT"d\n", sizeof(int));
}

$ g++ -std=c++11 -Wall t.cc
t.cc: In function 'int main()':
t.cc:6:24: error: unable to find string literal operator 'operator"" SIZET_FMT'

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments