Commit 1cb96634 authored by Federico Vaga's avatar Federico Vaga

lib: when compiling with g++ ingore string warning

This is a C library that it can be used by C++ programs as well.
So the library header will be included in some C++ program and g++
will rise warnings like this:

------
fmcadc-lib.h: In function 'int fmcadc_mshot_buf_max_size_get(fmcadc_dev*, int*)':
fmcadc-lib.h:202:74: warning: deprecated conversion from string constant to 'char*'
[-Wwrite-strings]
         return fmcadc_get_param(dev, "cset0/max-sample-mshot", NULL, value);
------

This patch will suppress all these warning because what we are doing is
correct. The message says that it's deprecated; probably at some point
in time it will not be supported at all and we will see errors instead
of warnings. This patch is suppressing only the warnings.

For the time being we prefer this solution instead of casting strings
to `(char *)` because it's ugly and unclear from C point of view.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
Signed-off-by: Juan David González Cobas's avatarJuan David Gonzalez Cobas <dcobas@cern.ch>
parent 763fa688
......@@ -7,6 +7,7 @@
#define FMCADC_LIB_H_
#ifdef __cplusplus
#pragma GCC diagnostic ignored "-Wwrite-strings"
extern "C" {
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment