summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2020-09-03 18:22:01 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2020-09-03 19:11:48 +0200
commit2df656f646d7962234d3f87f4ced548b33f7a871 (patch)
tree36971ad85c63cc3815954fd6b07b2e33228de4a1
parentda08d10fce3b249f27fe99fcaa5e3da834a72236 (diff)
downloadstrace-2df656f646d7962234d3f87f4ced548b33f7a871.tar.gz
mpers_test.sh: check proper handling of sized integer types
The commit v5.6~62 ("v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands") unraveled a possibility of buggy handling of sized integer types in some libc implementations[1][2]. Add checks for these types to mpers_test.sh to catch such issues early. [1] https://strace.io/logs/strace/2020-04-22#17477; [2] https://lists.strace.io/pipermail/strace-devel/2020-August/010213.html * mpers_test.sh: Add checks for (u)int{8,16,32,64}_t types. Complements: v5.6~62 "v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands"
-rwxr-xr-xmpers_test.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/mpers_test.sh b/mpers_test.sh
index 110ce092f..6563e394e 100755
--- a/mpers_test.sh
+++ b/mpers_test.sh
@@ -22,6 +22,7 @@ mkdir -p "$mpers_dir"
sample="$mpers_dir/sample.c"
cat > "$sample" <<EOF
+#include <stdint.h>
#include "mpers_type.h"
#include DEF_MPERS_TYPE(sample_struct)
typedef struct {
@@ -56,6 +57,14 @@ typedef struct {
unsigned short us[4];
char sc;
unsigned char uc;
+ int8_t i8;
+ int16_t i16;
+ int32_t i32;
+ int64_t i64;
+ uint8_t u8;
+ uint16_t u16;
+ uint32_t u32;
+ uint64_t u64;
} u[3][2];
short f[0];
} sample_struct;
@@ -103,6 +112,14 @@ int16_t ss[7][9];
uint16_t us[4];
char sc;
unsigned char uc;
+signed char i8;
+int16_t i16;
+int32_t i32;
+int64_t i64;
+unsigned char u8;
+uint16_t u16;
+uint32_t u32;
+uint64_t u64;
} u[3][2];
int16_t f[0];
} ATTRIBUTE_PACKED ${mpers_name}_sample_struct;