Eclipse marks macros from inttypes.h as syntax errorshttps://www.eclipse.org/forums/index.php/mv/msg/458015/1016685/#msg_1016685
When I am using macros from inttypes.h (that allow for portable usage of printf-like formatting string across architectures), e.g., like this:

printf("This is a 64-bit integer: %"PRId64".\n", (int64_t)23);

Eclipse marks the line as "Syntax error". This is very annoying in code that uses many printf-like functions (fprintf, sprintf, fscanf, sscanf, etc). I am compiling the code using a manually generated makefile and everything compiles and runs so that I assume that the problem is with Eclipse?

/* The ISO C99 standard specifies that these macros must only be
defined if explicitly requested. */
#if !defined __cplusplus || defined __STDC_FORMAT_MACROS

=> you must define __STDC_FORMAT_MACROS to get it working.

I guess you are setting this define in your Makefile. You should add this define in Eclipse to Project Properties->C/C++ General->Paths and Symbols]]>Axel Mueller2013-03-08T08:27:40-00:00Re: Eclipse marks macros from inttypes.h as syntax errorshttps://www.eclipse.org/forums/index.php/mv/msg/458015/1017002/#msg_1017002
thanks for your answer. I didn't mention that in my question but I am already defining __STDC_FORMAT_MACROS prior to including inttypes.h. So, this seems not to be the issue.

I didn't mention that in my question but I am already defining __STDC_FORMAT_MACROS prior to including inttypes.h.

Where do you define it?
Do you use something like this?

#define__STDC_FORMAT_MACROS
#include <inttypes.h>

This did not work for me. You have to set the define in Project Properties->C/C++ General->Paths and Symbols
]]>Axel Mueller2013-03-13T12:33:25-00:00Re: Eclipse marks macros from inttypes.h as syntax errorshttps://www.eclipse.org/forums/index.php/mv/msg/458015/1068168/#msg_1068168
Best,
Konstantin]]>Konstantin Miller2013-07-12T13:56:38-00:00