]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Suppress cppcheck invalidSyntax warninigs
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 6 Mar 2021 01:56:35 +0000 (17:56 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 8 Mar 2021 17:07:25 +0000 (09:07 -0800)
For some reason cppcheck 1.90 is generating an invalidSyntax warning
when the BF64_SET macro is used in the zstream source.  The same
warning is not reported by cppcheck 2.3, nor is their any evident
problem with the expanded macro.  This appears to be an issue with
this version of cppcheck.  This commit annotates the source to suppress
the warning.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11700

cmd/zstream/zstream_redup.c
include/sys/dmu_redact.h

index 41f1068e3dfc274812adf904237787c5ceaefdc7..15dd8a1ed1267b6f0a59253298bd682b00aad6e9 100644 (file)
@@ -248,6 +248,7 @@ zfs_redup_stream(int infd, int outfd, boolean_t verbose)
                        fflags = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
                        fflags &= ~(DMU_BACKUP_FEATURE_DEDUP |
                            DMU_BACKUP_FEATURE_DEDUPPROPS);
+                       /* cppcheck-suppress syntaxError */
                        DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags);
 
                        int sz = drr->drr_payloadlen;
index 207fdbb5cfda068353df8e50b41183906f1ecf47..85f4b05228919f9bbc1339d7f34014c2d964c777 100644 (file)
@@ -39,6 +39,7 @@ redact_block_get_size(redact_block_phys_t *rbp)
 static inline void
 redact_block_set_size(redact_block_phys_t *rbp, uint64_t size)
 {
+       /* cppcheck-suppress syntaxError */
        BF64_SET_SB((rbp)->rbp_size_count, 48, 16, SPA_MINBLOCKSHIFT, 0, size);
 }
 
@@ -51,6 +52,7 @@ redact_block_get_count(redact_block_phys_t *rbp)
 static inline void
 redact_block_set_count(redact_block_phys_t *rbp, uint64_t count)
 {
+       /* cppcheck-suppress syntaxError */
        BF64_SET_SB((rbp)->rbp_size_count, 0, 48, 0, 1, count);
 }