summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/pointer-arithmetic.c
AgeCommit message (Collapse)Author
2022-07-22Strengthen -Wint-conversion to default to an errorAaron Ballman
Clang has traditionally allowed C programs to implicitly convert integers to pointers and pointers to integers, despite it not being valid to do so except under special circumstances (like converting the integer 0, which is the null pointer constant, to a pointer). In C89, this would result in undefined behavior per 3.3.4, and in C99 this rule was strengthened to be a constraint violation instead. Constraint violations are most often handled as an error. This patch changes the warning to default to an error in all C modes (it is already an error in C++). This gives us better security posture by calling out potential programmer mistakes in code but still allows users who need this behavior to use -Wno-error=int-conversion to retain the warning behavior, or -Wno-int-conversion to silence the diagnostic entirely. Differential Revision: https://reviews.llvm.org/D129881
2010-09-13Congruent diagnostic for void* arithmetic.Abramo Bagnara
llvm-svn: 113740
2009-12-15Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar
- This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
2009-03-24Rename clang to clang-cc.Daniel Dunbar
Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
2009-01-27eliminate some random .ll file outputsChris Lattner
llvm-svn: 63117
2009-01-23Handle pointer arithmetic on function pointers.Daniel Dunbar
- <rdar://problem/6518844> Clang-generated bitcode crashes LLVM while compiling function pointer addition expression llvm-svn: 62857
2008-08-21Update a number of CodeGen tests to not create .ll files in the testDaniel Dunbar
directory. - Removed .ll from the svn:ignore lists to try and prevent this. - Added svn:ignore on test/Misc/Output llvm-svn: 55104
2007-12-26Remove broken assert from CodeGen. Better check is done in Sema.Seo Sanghyeon
llvm-svn: 45358
2007-12-03Ignore typedefs in pointer arithmetic codegen.Seo Sanghyeon
llvm-svn: 44529