Macro redefinitions

In DataTypes.h starting on line 121 are these lines:
#define INT8_C(C) C
#define UINT8_C(C) C
#define INT16_C(C) C
#define UINT16_C(C) C
#define INT32_C(C) C
#define UINT32_C(C) C ## U
#define INT64_C(C) ((int64_t) C ## LL)
#define UINT64_C(C) ((uint64_t) C ## ULL)

They are conflicting with the cstdint when we have updated headers in
our MSVC build. I could have sworn I talked about this before along
with a patch, guess no one ever fixed it, hence consider this a poke.

The above lines should be changed into:

#ifndef INT8_C
# define INT8_C(C) C
#endif
#ifndef UINT8_C
# define UINT8_C(C) C
#endif
#ifndef INT16_C
# define INT16_C(C) C
#endif
#ifndef UINT16_C
# define UINT16_C(C) C
#endif
#ifndef INT32_C
# define INT32_C(C) C
#endif
#ifndef UINT32_C
# define UINT32_C(C) C ## U
#endif
#ifndef INT64_C
# define INT64_C(C) ((int64_t) C ## LL)
#endif
#ifndef UINT64_C
# define UINT64_C(C) ((uint64_t) C ## ULL)
#endif

Do note, the above is not correct anyway since it does not cast the
value, but meh, it still works.
I am not sure about the size macro's or the typedefs, but I am not
getting any issues on those...

OvermindDL1 <overminddl1@gmail.com> writes:

In DataTypes.h starting on line 121 are these lines:
#define INT8_C(C) C
#define UINT8_C(C) C
#define INT16_C(C) C
#define UINT16_C(C) C
#define INT32_C(C) C
#define UINT32_C(C) C ## U
#define INT64_C(C) ((int64_t) C ## LL)
#define UINT64_C(C) ((uint64_t) C ## ULL)

They are conflicting with the cstdint when we have updated headers in
our MSVC build.

Can you provide more context information about this? What do you mean by
"updated headers"? cstdint seems missing on my VC++ 2008 install. Is
that part of some upgrade? Which one?

[snip]

OvermindDL1 <overminddl1@gmail.com> writes:

[snip]

If you are curious, the remaining non-pedantic warnings are:

An actual warning that should be fixed:
4>r:\sdks\llvm\trunk\utils\tablegen\CodeGenDAGPatterns.h(27) : warning
C4099: 'llvm::Init' : type name first seen using 'class' now seen
using 'struct'

[snipped some more warnings]

The rest of the project compiles clean in non-pedantic mode, quite
wonderful. :slight_smile:

Not so wonderful. Lots of warnings are disabled:

  add_llvm_definitions( -wd4146 -wd4503 -wd4996 -wd4800 -wd4244 -wd4624 )
  add_llvm_definitions( -wd4355 -wd4715 -wd4180 -wd4345 -wd4224 )
  add_llvm_definitions( -wd4351 )

It's very likely that some of those warnings are really useful (i.e. are
hinting at bugs.) OTOH, keeping LLVM warning-free for VC++ and gcc at
the same time looks like a never-ending uphill battle.