add warning control macro set 66/9266/2
authorGabriel Ganne <gabriel.ganne@enea.com>
Tue, 7 Nov 2017 13:24:56 +0000 (14:24 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 10 Nov 2017 20:28:45 +0000 (20:28 +0000)
commitbeb85cc662beda891989872b90bfd2a95e3c7a5a
treee5123053d4eb198298381e7e2b993cec56c9510b
parent0f85333a94e176ab915e583ff66c8774cdbda620
add warning control macro set

Add a way to toggle on and off a warning for a specific section of code.
This supports clang and gcc, and has no effect for any other compilers.

This follows commit bfc29ba442dbb65599f29fe5aa44c6219ed0d3a8 and
provides a generic way to handle warnings in such corner cases.

To disable a warning enabled by "-Wsome-warning" for a specific code:
  WARN_OFF(some-warning)  // disable compiler warning
  ; /* some code */
  WARN_ON(some-warning)   // enable the warning again

Change-Id: I0101caa0aa775e2b905c7b3b5fef3bbdce281673
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
src/vnet/bfd/bfd_cli.c
src/vppinfra/warnings.h [new file with mode: 0644]