Skip to content

Commit

Permalink
Forbid asctime{,_r}(), gmtime(), localtime()
Browse files Browse the repository at this point in the history
ctime() is only used in binary main threads, which is fine

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#13284
  • Loading branch information
nabijaczleweli authored and andrewc12 committed Sep 23, 2022
1 parent 8152fef commit 8fd0644
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/Rules.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ AM_CPPFLAGS += -D"dirname(...)=dirname(__VA_ARGS__) __attribute__((deprecated(\"
AM_CPPFLAGS += -D"bcopy(...)=__attribute__((deprecated(\"bcopy(3) is deprecated. Use memcpy(3)/memmove(3) instead!\"))) bcopy(__VA_ARGS__)"
AM_CPPFLAGS += -D"bcmp(...)=__attribute__((deprecated(\"bcmp(3) is deprecated. Use memcmp(3) instead!\"))) bcmp(__VA_ARGS__)"
AM_CPPFLAGS += -D"bzero(...)=__attribute__((deprecated(\"bzero(3) is deprecated. Use memset(3) instead!\"))) bzero(__VA_ARGS__)"
AM_CPPFLAGS += -D"asctime(...)=__attribute__((deprecated(\"Use strftime(3) instead!\"))) asctime(__VA_ARGS__)"
AM_CPPFLAGS += -D"asctime_r(...)=__attribute__((deprecated(\"Use strftime(3) instead!\"))) asctime_r(__VA_ARGS__)"
AM_CPPFLAGS += -D"gmtime(...)=__attribute__((deprecated(\"gmtime(3) isn't thread-safe. Use gmtime_r(3) instead!\"))) gmtime(__VA_ARGS__)"
AM_CPPFLAGS += -D"localtime(...)=__attribute__((deprecated(\"localtime(3) isn't thread-safe. Use localtime_r(3) instead!\"))) localtime(__VA_ARGS__)"

if ASAN_ENABLED
AM_CPPFLAGS += -DZFS_ASAN_ENABLED
Expand Down

0 comments on commit 8fd0644

Please sign in to comment.