From e39437b25eed393b8a7fcae480cd2e1801f00efe Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 12 Aug 2020 09:18:44 +0000 Subject: [PATCH 1/1] bacula: Fix build with GCC 10 GCC 10 aborts compilation when nunbers are (potentially) out of range when casted from one type to another: fstype.c: In function 'bool fstype(FF_PKT*, char*, int)': fstype.c:207:12: error: narrowing conversion of '4283649346' from 'unsigned int' to 'int' [-Wnarrowing] 207 | case 0xFF534D42: fstype = "cifs"; break; /* CIFS_MAGIC_NUMBER */ | ^~~~~~~~~~ fstype.c:216:12: error: narrowing conversion of '4187351113' from 'unsigned int' to 'int' [-Wnarrowing] 216 | case 0xf995e849: fstype = "hpfs"; break; /* HPFS_SUPER_MAGIC */ | ^~~~~~~~~~ fstype.c:217:12: error: narrowing conversion of '2508478710' from 'unsigned int' to 'int' [-Wnarrowing] 217 | case 0x958458f6: fstype = "hugetlbfs"; break; /* HUGETLBFS_MAGIC */ | ^~~~~~~~~~ fstype.c:234:12: error: narrowing conversion of '2768370933' from 'unsigned int' to 'int' [-Wnarrowing] 234 | case 0xa501FCF5: fstype = "vxfs"; break; | ^~~~~~~~~~ fstype.c:237:12: error: narrowing conversion of '2435016766' from 'unsigned int' to 'int' [-Wnarrowing] 237 | case 0x9123683e: fstype = "btrfs"; break; | ^~~~~~~~~~ Does nobody build this for 32 bit any more? Signed-off-by: Michael Tremer --- lfs/bacula | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lfs/bacula b/lfs/bacula index f5220bf163..3201688f46 100644 --- a/lfs/bacula +++ b/lfs/bacula @@ -36,6 +36,9 @@ PAK_VER = 6 DEPS = +# For GCC 10 +CFLAGS += -Wno-error=narrowing + ############################################################################### # Top-level Rules ############################################################################### -- 2.39.2