]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
bacula: Fix build with GCC 10
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Aug 2020 09:18:44 +0000 (09:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 16 Aug 2020 10:29:42 +0000 (10:29 +0000)
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 <michael.tremer@ipfire.org>
lfs/bacula

index f5220bf163381ed91b623eb0504cfeb46ceef1c9..3201688f46b5f2e2ba544e31f1d82547e2a799c2 100644 (file)
@@ -36,6 +36,9 @@ PAK_VER    = 6
 
 DEPS       =
 
+# For GCC 10
+CFLAGS    += -Wno-error=narrowing
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################