From: Jordan Rose Date: Fri, 1 Feb 2013 19:50:01 +0000 (+0000) Subject: [analyzer] Explain why we have system-header-simulator*.h files. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c888b10fdd2846885e8582b131fa076ce1b77b1;p=clang [analyzer] Explain why we have system-header-simulator*.h files. Suggested by Csaba. Text based on an e-mail of mine on cfe-dev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174213 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/Inputs/system-header-simulator-cxx.h b/test/Analysis/Inputs/system-header-simulator-cxx.h index e762d0a1bd..faca0b41aa 100644 --- a/test/Analysis/Inputs/system-header-simulator-cxx.h +++ b/test/Analysis/Inputs/system-header-simulator-cxx.h @@ -1,3 +1,8 @@ +// Like the compiler, the static analyzer treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be fixed by the user and should be +// suppressed. #pragma clang system_header namespace std { diff --git a/test/Analysis/Inputs/system-header-simulator-for-simple-stream.h b/test/Analysis/Inputs/system-header-simulator-for-simple-stream.h index 99986f4549..f08f3f6e3a 100644 --- a/test/Analysis/Inputs/system-header-simulator-for-simple-stream.h +++ b/test/Analysis/Inputs/system-header-simulator-for-simple-stream.h @@ -1,4 +1,8 @@ - +// Like the compiler, the static analyzer treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be fixed by the user and should be +// suppressed. #pragma clang system_header typedef struct __sFILE { diff --git a/test/Analysis/Inputs/system-header-simulator-objc.h b/test/Analysis/Inputs/system-header-simulator-objc.h index a647b37404..ecc99e17c4 100644 --- a/test/Analysis/Inputs/system-header-simulator-objc.h +++ b/test/Analysis/Inputs/system-header-simulator-objc.h @@ -1,3 +1,8 @@ +// Like the compiler, the static analyzer treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be fixed by the user and should be +// suppressed. #pragma clang system_header typedef unsigned int UInt32; diff --git a/test/Analysis/Inputs/system-header-simulator.h b/test/Analysis/Inputs/system-header-simulator.h index e28b890603..4c12131645 100644 --- a/test/Analysis/Inputs/system-header-simulator.h +++ b/test/Analysis/Inputs/system-header-simulator.h @@ -1,3 +1,8 @@ +// Like the compiler, the static analyzer treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be fixed by the user and should be +// suppressed. #pragma clang system_header typedef struct _FILE FILE;