[LLVMbugs] [Bug 6786] New: New parameter to assume function parameters are nonnull by default
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Apr 5 13:42:17 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=6786
Summary: New parameter to assume function parameters are
nonnull by default
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: tss at iki.fi
CC: llvmbugs at cs.uiuc.edu
The nonnull attribute is kind of nice in theory and static analyzer gives
useful output with them, but since in typical code most parameters are nonnull,
it's annoying to specify it in 99% of function declarations.
So what if there was instead a new parameter that changes the default to assume
that all parameters are nonnull, unless overridden? The overriding could happen
in two ways:
a) nonnull attribute specified for the function and doesn't list some specific
parameter
b) nonnull attribute doesn't work if all parameters can be null, so there would
also have to be a new null attribute that works opposite to what nonnull does.
There are of course them potential problems with false positive warnings with
libc and other external libraries, but I'm hoping they won't cause too much
trouble.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list