This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ODBM_File.xs: silence -Wc++-compat warning
authorDavid Mitchell <davem@iabyn.com>
Tue, 1 Dec 2020 15:12:14 +0000 (15:12 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 1 Dec 2020 15:12:14 +0000 (15:12 +0000)
Under gcc -Wc++-compat, it warns that 'delete' is a keyword. Since this
is the name of the actual function in odbm, just temporarily disable
the warning.

ext/ODBM_File/ODBM_File.pm
ext/ODBM_File/ODBM_File.xs

index 7bdbecc..1b49440 100644 (file)
@@ -7,7 +7,7 @@ require Tie::Hash;
 require XSLoader;
 
 our @ISA = qw(Tie::Hash);
-our $VERSION = "1.16";
+our $VERSION = "1.17";
 
 XSLoader::load();
 
index 9b70811..38e6dbf 100644 (file)
@@ -181,6 +181,14 @@ int
 odbm_DELETE(db, key)
        ODBM_File       db
        datum_key       key
+       CODE:
+            /* don't warn about 'delete' being a C++ keyword */
+            GCC_DIAG_IGNORE_STMT(-Wc++-compat);
+           RETVAL = odbm_DELETE(db, key);
+            GCC_DIAG_RESTORE_STMT;
+       OUTPUT:
+         RETVAL
+
 
 datum_key
 odbm_FIRSTKEY(db)