[PATCH] A couple minor changes to support sanitizers on FreeBSD 9.2

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon Mar 17 06:06:47 PDT 2014


  > Do I understand correctly that this problem will fire on *any* program that is:
  > a) compiled with Clang on FreeBSD 9.2
  > b) includes stddef.h (i.e. Clang's header)
  > c) includes sys/types.h

  Yes, any program that is a), b) and includes one of the numerous system headers that directly define 'size_t' (and thus directly or indirectly include <sys/types.h>).

  > it seems impractical to force all FreeBSD users provide -D_SIZE_T_DECLARED.

  Well, bugs are usually a kind of impractical thing? :-)

  > Can we work around this issue in Clang's stddef.h instead? E.g. use:
  > #undef size_t
  > typedef __SIZE_TYPE__ size_t;
  > #define _SIZE_T_DECLARED

  No, since we can't be sure <stddef.h> is included in front of other system headers.

http://llvm-reviews.chandlerc.com/D3031



More information about the llvm-commits mailing list