Add __attribute__((sentinel)) tags to execl and friends.

Give a compile time diagnostic when the nullptr sentinel is missing
from an execl family call, instead of just pulling arbitrary values.

Bug: http://b/30793878
Change-Id: I1c49005c58b7ad4a5b04f0435b722d4c744e8f0e
Test: Built bullhead
This commit is contained in:
Josh Gao 2016-08-10 15:18:29 -07:00
parent 6ba5f07e3f
commit d80a52eb65
1 changed files with 4 additions and 3 deletions

View File

@ -97,9 +97,10 @@ int execv(const char* __path, char* const* __argv);
int execvp(const char* __file, char* const* __argv);
int execvpe(const char* __file, char* const* __argv, char* const* __envp) __INTRODUCED_IN(21);
int execve(const char* __file, char* const* __argv, char* const* __envp);
int execl(const char* __path, const char* __arg0, ...);
int execlp(const char* __file, const char* __arg0, ...);
int execle(const char* __path, const char* __arg0, ...);
int execl(const char* __path, const char* __arg0, ...) __attribute__((__sentinel__));
int execlp(const char* __file, const char* __arg0, ...) __attribute__((__sentinel__));
int execle(const char* __path, const char* __arg0, ... /*, char* const* __envp */)
__attribute__((__sentinel__(1)));
int nice(int __incr);