Skip to content

Commit 3263675

Browse files
collinfunkcodonell
authored andcommitted
linux: Fix integer overflow warnings when including <sys/mount.h> [BZ #32708]
Using gcc -Wshift-overflow=2 -Wsystem-headers to compile a file including <sys/mount.h> will cause a warning since 1 << 31 is undefined behavior on platforms where int is 32-bits. Signed-off-by: Collin Funk <collin.funk1@gmail.com> Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
1 parent cd33535 commit 3263675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sysdeps/unix/sysv/linux/sys/mount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ enum
121121
MS_ACTIVE = 1 << 30,
122122
#define MS_ACTIVE MS_ACTIVE
123123
#undef MS_NOUSER
124-
MS_NOUSER = 1 << 31
124+
MS_NOUSER = 1U << 31
125125
#define MS_NOUSERMS_NOUSER
126126
};
127127

0 commit comments

Comments
 (0)