linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.28k stars 999 forks source link

Fix: compile warning: "NSEC_PER_SEC" redefined #985

Closed Rtoax closed 1 year ago

Rtoax commented 1 year ago

Fix

clock_settime02.c:17: warning: "NSEC_PER_SEC" redefined
   17 | #define NSEC_PER_SEC (1000000000L)
      |
In file included from ../../../../include/tst_timer.h:20,
                 from ../../../../include/time64_variants.h:20,
                 from clock_settime02.c:12:
../../../../include/lapi/common_timers.h:15: note: this is the location of the previous definition
   15 | #define NSEC_PER_SEC (1000000000LL)
      |
CC testcases/kernel/syscalls/clock_settime/clock_settime02
metan-ucw commented 1 year ago

Can we just remove the duplicate definition from the test?

Rtoax commented 1 year ago

Can we just remove the duplicate definition from the test?

Yes, i just remove the macro.

pevik commented 1 year ago

Thanks a lot for a fix.

FYI the definition should have been removed in 4de7fcaa63c5f2598c88753be30ad3ff2318e5e8, when include/lapi/common_timers.h (which includes the original definition) was included in include/tst_timer.h (which was included before into affected clock_settime02.c.