Hello Andreas Hansson, Curtis Dunham,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/3241
to review the following change.
Change subject: syscall_emu: Fix undefined macro behavior
......................................................................
syscall_emu: Fix undefined macro behavior
Clang's UBSAN implementation complains about macros that expand to
expressions that contain 'defined'. Explicitly set the various feature
macros to 1 or 0 to avoid this issue.
Change-Id: Iba239dacfe526c43ab9c5da5183a350fc4fdc57d
Signed-off-by: Andreas Sandberg <[email protected]>
Reviewed-by: Andreas Hansson <[email protected]>
Reviewed-by: Curtis Dunham <[email protected]>
---
M src/sim/syscall_emul.hh
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index a1c3b29..53c053f 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -45,15 +45,27 @@
#ifndef __SIM_SYSCALL_EMUL_HH__
#define __SIM_SYSCALL_EMUL_HH__
-#define NO_STAT64 (defined(__APPLE__) || defined(__OpenBSD__) || \
- defined(__FreeBSD__) || defined(__CYGWIN__) || \
- defined(__NetBSD__))
+#if (defined(__APPLE__) || defined(__OpenBSD__) || \
+ defined(__FreeBSD__) || defined(__CYGWIN__) || \
+ defined(__NetBSD__))
+#define NO_STAT64 1
+#else
+#define NO_STAT64 0
+#endif
-#define NO_STATFS (defined(__APPLE__) || defined(__OpenBSD__) || \
- defined(__FreeBSD__) || defined(__NetBSD__))
+#if (defined(__APPLE__) || defined(__OpenBSD__) || \
+ defined(__FreeBSD__) || defined(__NetBSD__))
+#define NO_STATFS 1
+#else
+#define NO_STATFS 0
+#endif
-#define NO_FALLOCATE (defined(__APPLE__) || defined(__OpenBSD__) || \
- defined(__FreeBSD__) || defined(__NetBSD__))
+#if (defined(__APPLE__) || defined(__OpenBSD__) || \
+ defined(__FreeBSD__) || defined(__NetBSD__))
+#define NO_FALLOCATE 1
+#else
+#define NO_FALLOCATE 0
+#endif
///
/// @file syscall_emul.hh
--
To view, visit https://gem5-review.googlesource.com/3241
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba239dacfe526c43ab9c5da5183a350fc4fdc57d
Gerrit-Change-Number: 3241
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Andreas Hansson <[email protected]>
Gerrit-Reviewer: Curtis Dunham <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev