Skip to content

Commit d53feb5

Browse files
committed
Merge branch 'jk/banned'
Non-reentrant time-related library functions and ctime/asctime with awkward calling interfaces are banned from the codebase. * jk/banned: banned.h: mark ctime_r() and asctime_r() as banned banned.h: mark non-reentrant gmtime, etc as banned
2 parents bb48056 + 91aef03 commit d53feb5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

banned.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,17 @@
2929
#define vsprintf(buf,fmt,arg) BANNED(vsprintf)
3030
#endif
3131

32+
#undef gmtime
33+
#define gmtime(t) BANNED(gmtime)
34+
#undef localtime
35+
#define localtime(t) BANNED(localtime)
36+
#undef ctime
37+
#define ctime(t) BANNED(ctime)
38+
#undef ctime_r
39+
#define ctime_r(t, buf) BANNED(ctime_r)
40+
#undef asctime
41+
#define asctime(t) BANNED(asctime)
42+
#undef asctime_r
43+
#define asctime_r(t, buf) BANNED(asctime_r)
44+
3245
#endif /* BANNED_H */

0 commit comments

Comments
 (0)