• Federico Vaga's avatar
    lib: when compiling with g++ ingore string warning · 1cb96634
    Federico Vaga authored
    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>
    1cb96634
fmcadc-lib.h 6.76 KB