aboutsummaryrefslogtreecommitdiff
path: root/clint.py
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-01-12 23:50:08 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-01-12 23:50:08 -0500
commit9c090e9329679d5659d61f1c3f4fc5452417a027 (patch)
treee9014351eba5f9af137b41d71cd9ac14c3c69e71 /clint.py
parent9d0be9604eac8ddd9f856baa0f07625754c4967b (diff)
parent470b87e377686121e2387e20343a7ba15b2a974f (diff)
downloadrneovim-9c090e9329679d5659d61f1c3f4fc5452417a027.tar.gz
rneovim-9c090e9329679d5659d61f1c3f4fc5452417a027.tar.bz2
rneovim-9c090e9329679d5659d61f1c3f4fc5452417a027.zip
Merge pull request #1792 from fwalch/clint_remove-rand_r
Linting: Recommend os_* instead of POSIX functions.
Diffstat (limited to 'clint.py')
-rwxr-xr-xclint.py39
1 files changed, 25 insertions, 14 deletions
diff --git a/clint.py b/clint.py
index 28b51fbc9c..38bc13df7f 100755
--- a/clint.py
+++ b/clint.py
@@ -1198,18 +1198,28 @@ def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
threading_list = (
- ('asctime(', 'asctime_r('),
- ('ctime(', 'ctime_r('),
- ('getgrgid(', 'getgrgid_r('),
- ('getgrnam(', 'getgrnam_r('),
- ('getlogin(', 'getlogin_r('),
- ('getpwnam(', 'getpwnam_r('),
- ('getpwuid(', 'getpwuid_r('),
- ('gmtime(', 'gmtime_r('),
- ('localtime(', 'localtime_r('),
- ('rand(', 'rand_r('),
- ('strtok(', 'strtok_r('),
- ('ttyname(', 'ttyname_r('),
+ ('asctime(', 'os_asctime_r('),
+ ('ctime(', 'os_ctime_r('),
+ ('getgrgid(', 'os_getgrgid_r('),
+ ('getgrnam(', 'os_getgrnam_r('),
+ ('getlogin(', 'os_getlogin_r('),
+ ('getpwnam(', 'os_getpwnam_r('),
+ ('getpwuid(', 'os_getpwuid_r('),
+ ('gmtime(', 'os_gmtime_r('),
+ ('localtime(', 'os_localtime_r('),
+ ('strtok(', 'os_strtok_r('),
+ ('ttyname(', 'os_ttyname_r('),
+ ('asctime_r(', 'os_asctime_r('),
+ ('ctime_r(', 'os_ctime_r('),
+ ('getgrgid_r(', 'os_getgrgid_r('),
+ ('getgrnam_r(', 'os_getgrnam_r('),
+ ('getlogin_r(', 'os_getlogin_r('),
+ ('getpwnam_r(', 'os_getpwnam_r('),
+ ('getpwuid_r(', 'os_getpwuid_r('),
+ ('gmtime_r(', 'os_gmtime_r('),
+ ('localtime_r(', 'os_localtime_r('),
+ ('strtok_r(', 'os_strtok_r('),
+ ('ttyname_r(', 'os_ttyname_r('),
)
@@ -1235,9 +1245,10 @@ def CheckPosixThreading(filename, clean_lines, linenum, error):
if ix >= 0 and (ix == 0 or (not line[ix - 1].isalnum() and
line[ix - 1] not in ('_', '.', '>'))):
error(filename, linenum, 'runtime/threadsafe_fn', 2,
- 'Consider using ' + multithread_safe_function +
+ 'Use ' + multithread_safe_function +
'...) instead of ' + single_thread_function +
- '...) for improved thread safety.')
+ '...). If it is missing, consider implementing it;' +
+ ' see os_localtime_r for an example.')
# Matches invalid increment: *count++, which moves pointer instead of