Skip to content

Commit

Permalink
Give the Coverity scanner some more GCC blinders...
Browse files Browse the repository at this point in the history
Coverity complains:

  CID 373676 (rhboot#3 of 3): Unrecoverable parse warning (PARSE_ERROR)
  1. arguments_provided_for_attribute: attribute "__malloc__" does not take arguments

This is, of course, just plain wrong.  Even so, I'm tired of looking at
it, so this patch wraps the #define we use for that attribute in a check
to see if it's being built by Coverity.

Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed May 23, 2022
1 parent 759f061 commit aa61fdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@
#define ALIAS(x) __attribute__((weak, alias (#x)))
#endif
#ifndef ALLOCFUNC
#if defined(__COVERITY__)
#define ALLOCFUNC(a, b)
#else
#define ALLOCFUNC(dealloc, dealloc_arg) __attribute__((__malloc__(dealloc, dealloc_arg)))
#endif
#endif
#ifndef PRINTF
#define PRINTF(first, args...) __attribute__((__format__(printf, first, ## args)))
#endif
Expand Down

0 comments on commit aa61fdf

Please sign in to comment.