Closed tomalakgeretkal closed 4 years ago
Actually, I worked out the build failure: since C++11 only integer literals can be null pointer constants, so this codebase basically just won't build since C++11.
That file is part of the old libfet
of NBIS, which is an old C library. It should be compiled with the -ansi
(C89) flag. I'm immediately unsure why the .cpp
extension was given to this file, as it's not necessarily valid to compile C code with a C++ compiler (as you've seen). I believe the code is attempting to clear the string by setting the first character of it as the null terminator. clang++
treats this as a warning (non-literal null conversion), though as you've seen on Stack Overflow, at least one compiler treats it as an error.
This needs to be fixed, but the first fix should be to compile with $(CC)
not $(CXX)
. We'll keep this open so that we can work on this in the iso_wg3
branch for the next release. Thanks!
Correct me if I'm wrong, but in neither language does this set the first character of the string as the null terminator. It replaced the string with a null pointer, using code that does not appear to express that intent, which makes me wonder whether this is perhaps not expected and thus not properly handled elsewhere. Changing language modes doesn't fix that; it merely masks the problem.
@tomalakgeretkal You're not wrong. I believe the author's attempt was to clear the string, but as you suggest, that code does not accomplish it. Throwing a *
in front might. This needs to be fixed upstream and re-integrated. However, compiling this code as C++ when it is C89 is certainly introducing other bugs. I'm suggesting that both need to be addressed.
Upstream actually has ... = NULL
, not ... = '\0'
, so we're out of sync at a minimum.
Replacing with nullptr worked for me. Will be using that for now. I'm not able to build latest branch. I'm working on raspberry pi4 and buster image. CMake files are not built for ARM . I tried to mess with it a little bit , it did indeed move ahead but got issues with libpthread. I'm new to cmake and not sure how to fix. Let me know if anyone else is also in same situation. I love to try latest branch on raspberry
I've tried to replace with nullpr but hit new errors c++11 here, tried to pass std=C++03 to the makefile also with no luck.
src/wsq/nistcom.cpp: In function ‘int combine_nistcom(NISTCOM*, int, int, int, int, int)’: include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 58 #define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:118:31: note: in expansion of macro ‘NCM_HEADER’ 118if((ret = updatefet_ret(NCM_HEADER, "6", nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp:118:43: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 118if((ret = updatefet_ret(NCM_HEADER, "6", nistcom))){ ^~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:59:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 59 #define NCM_PIX_WIDTH "PIX_WIDTH" / manditory / ^ ~~src/wsq/nistcom.cpp:134:28: note: in expansion of macro ‘NCM_PIX_WIDTH’ 134if((ret = updatefet_ret(NCM_PIX_WIDTH, cbuff, nistcom))){ ^ ~~~~ include/wsq/nistcom.h:60:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 60#define NCM_PIX_HEIGHT "PIX_HEIGHT" / manditory / ^ ~~~ src/wsq/nistcom.cpp:144:28: note: in expansion of macro ‘NCM_PIX_HEIGHT’ 144if((ret = updatefet_ret(NCM_PIX_HEIGHT, cbuff, nistcom))){ ^ ~~~~~ include/wsq/nistcom.h:61:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 61#define NCM_PIX_DEPTH "PIX_DEPTH" / 1,8,24 (manditory)/ ^ ~~src/wsq/nistcom.cpp:154:28: note: in expansion of macro ‘NCM_PIX_DEPTH’ 154if((ret = updatefet_ret(NCM_PIX_DEPTH, cbuff, nistcom))){ ^ ~~~~ include/wsq/nistcom.h:62:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 62#define NCM_PPI "PPI" / -1 if unknown (manditory)/ ^~~~~ src/wsq/nistcom.cpp:164:28: note: in expansion of macro ‘NCM_PPI’ 164 if((ret = updatefet_ret(NCM_PPI, cbuff, nistcom))){ ^ ~~ include/wsq/nistcom.h:71:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 71#define NCM_LOSSY "LOSSY" / 0,1 / ^ ~~ src/wsq/nistcom.cpp:174:31: note: in expansion of macro ‘NCM_LOSSY’ 174ret = lookupfet(&lossyval, NCM_LOSSY, nistcom); ^ ~~~~ include/wsq/nistcom.h:71:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 71#define NCM_LOSSY "LOSSY" / 0,1 / ^ ~~ src/wsq/nistcom.cpp:192:31: note: in expansion of macro ‘NCM_LOSSY’ 192if((ret = updatefet_ret(NCM_LOSSY, cbuff, nistcom))){ ^ ~~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:203:28: note: in expansion of macro ‘NCM_HEADER’ 203if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int combine_jpegl_nistcom(NISTCOM*, int, int, int, int, int, int, int, int, int, int)’: include/wsq/nistcom.h:63:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 63#define NCM_COLORSPACE "COLORSPACE" / RGB,YCbCr,GRAY / ^ ~~~ src/wsq/nistcom.cpp:239:31: note: in expansion of macro ‘NCM_COLORSPACE’ 239if((ret = updatefet_ret(NCM_COLORSPACE, "GRAY", nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp:239:47: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 239if((ret = updatefet_ret(NCM_COLORSPACE, "GRAY", nistcom))){ ^ ~In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:64:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 64#define NCM_N_CMPNTS "NUM_COMPONENTS" / [1..4] (manditory w/hv_factors)/ ^ ~~~src/wsq/nistcom.cpp:249:31: note: in expansion of macro ‘NCM_N_CMPNTS’ 249if((ret = updatefet_ret(NCM_N_CMPNTS, cbuff, nistcom))){ ^ ~~~ include/wsq/nistcom.h:65:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 65#define NCM_HV_FCTRS "HV_FACTORS" / H0,V0:H1,V1:.../ ^ ~~~ src/wsq/nistcom.cpp:264:31: note: in expansion of macro ‘NCM_HV_FCTRS’ 264if((ret = updatefet_ret(NCM_HV_FCTRS, cbuff, nistcom))){ ^ ~~~ include/wsq/nistcom.h:66:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 66#define NCM_INTRLV "INTERLEAVE" / 0,1 (manditory w/depth=24) / ^ ~~~ src/wsq/nistcom.cpp:272:31: note: in expansion of macro ‘NCM_INTRLV’ 272if((ret = updatefet_ret(NCM_INTRLV, cbuff, nistcom))){ ^ ~~~~~ include/wsq/nistcom.h:67:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 67#define NCM_COMPRESSION "COMPRESSION" / NONE,JPEGB,JPEGL,WSQ / ^ ~~~~ src/wsq/nistcom.cpp:280:28: note: in expansion of macro ‘NCM_COMPRESSION’ 280if((ret = updatefet_ret(NCM_COMPRESSION, "JPEGL", nistcom))){ ^ ~~~~~~ src/wsq/nistcom.cpp:280:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 280if((ret = updatefet_ret(NCM_COMPRESSION, "JPEGL", nistcom))){ ^ ~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:69:27: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 69#define NCM_JPEGL_PREDICT "JPEGL_PREDICT" / [1..7] / ^ ~~~~~~ src/wsq/nistcom.cpp:288:28: note: in expansion of macro ‘NCM_JPEGL_PREDICT’ 288if((ret = updatefet_ret(NCM_JPEGL_PREDICT, cbuff, nistcom))){ ^ ~~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:296:28: note: in expansion of macro ‘NCM_HEADER’ 296if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int combine_wsq_nistcom(NISTCOM*, int, int, int, int, int, float)’: include/wsq/nistcom.h:63:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 63#define NCM_COLORSPACE "COLORSPACE" / RGB,YCbCr,GRAY / ^ ~~~ src/wsq/nistcom.cpp:326:28: note: in expansion of macro ‘NCM_COLORSPACE’ 326if((ret = updatefet_ret(NCM_COLORSPACE, "GRAY", nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp:326:44: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 326if((ret = updatefet_ret(NCM_COLORSPACE, "GRAY", nistcom))){ ^ ~In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:67:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 67#define NCM_COMPRESSION "COMPRESSION" / NONE,JPEGB,JPEGL,WSQ / ^ ~~~~ src/wsq/nistcom.cpp:333:28: note: in expansion of macro ‘NCM_COMPRESSION’ 333if((ret = updatefet_ret(NCM_COMPRESSION, "WSQ", nistcom))){ ^ ~~~~~~ src/wsq/nistcom.cpp:333:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 333if((ret = updatefet_ret(NCM_COMPRESSION, "WSQ", nistcom))){ ^~~~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:70:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 70 #define NCM_WSQ_RATE "WSQ_BITRATE" / ex. .75,2.25 (-1.0 if unknown)/ ^ ~~~~ src/wsq/nistcom.cpp:341:28: note: in expansion of macro ‘NCM_WSQ_RATE’ 341if((ret = updatefet_ret(NCM_WSQ_RATE, cbuff, nistcom))){ ^ ~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:349:28: note: in expansion of macro ‘NCM_HEADER’ 349if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int combine_jpegb_nistcom(NISTCOM*, int, int, int, int, int, char, int, int, int)’: include/wsq/nistcom.h:63:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 63#define NCM_COLORSPACE "COLORSPACE" / RGB,YCbCr,GRAY / ^ ~~~ src/wsq/nistcom.cpp:380:28: note: in expansion of macro ‘NCM_COLORSPACE’ 380if((ret = updatefet_ret(NCM_COLORSPACE, colorspace, nistcom))){ ^ ~~~~~ include/wsq/nistcom.h:64:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 64#define NCM_N_CMPNTS "NUM_COMPONENTS" / [1..4] (manditory w/hv_factors)/ ^ ~~~src/wsq/nistcom.cpp:389:31: note: in expansion of macro ‘NCM_N_CMPNTS’ 389if((ret = updatefet_ret(NCM_N_CMPNTS, cbuff, nistcom))){ ^ ~~~ src/wsq/nistcom.cpp:397:17: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 397cptr = "1,1:1,1:1,1"; ^ ~~~~ src/wsq/nistcom.cpp:399:17: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 399cptr = "2,2:1,1:1,1"; ^ ~~~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:65:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 65#define NCM_HV_FCTRS "HV_FACTORS" / H0,V0:H1,V1:.../ ^ ~~~ src/wsq/nistcom.cpp:408:31: note: in expansion of macro ‘NCM_HV_FCTRS’ 408if((ret = updatefet_ret(NCM_HV_FCTRS, cptr, nistcom))){ ^ ~~~ include/wsq/nistcom.h:66:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 66#define NCM_INTRLV "INTERLEAVE" / 0,1 (manditory w/depth=24) / ^ ~~~ src/wsq/nistcom.cpp:416:31: note: in expansion of macro ‘NCM_INTRLV’ 416if((ret = updatefet_ret(NCM_INTRLV, cbuff, nistcom))){ ^ ~~~~~ include/wsq/nistcom.h:67:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 67#define NCM_COMPRESSION "COMPRESSION" / NONE,JPEGB,JPEGL,WSQ / ^ ~~~~ src/wsq/nistcom.cpp:424:28: note: in expansion of macro ‘NCM_COMPRESSION’ 424if((ret = updatefet_ret(NCM_COMPRESSION, "JPEGB", nistcom))){ ^ ~~~~~~ src/wsq/nistcom.cpp:424:45: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 424if((ret = updatefet_ret(NCM_COMPRESSION, "JPEGB", nistcom))){ ^ ~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:68:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 68#define NCM_JPEGB_QUAL "JPEGB_QUALITY" / [20..95] / ^ ~~~~~~ src/wsq/nistcom.cpp:432:28: note: in expansion of macro ‘NCM_JPEGB_QUAL’ 432if((ret = updatefet_ret(NCM_JPEGB_QUAL, cbuff, nistcom))){ ^ ~~~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:440:28: note: in expansion of macro ‘NCM_HEADER’ 440if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))){ ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int del_jpegl_nistcom(NISTCOM)’: include/wsq/nistcom.h:67:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 67#define NCM_COMPRESSION "COMPRESSION" / NONE,JPEGB,JPEGL,WSQ / ^ ~~~~ src/wsq/nistcom.cpp:456:28: note: in expansion of macro ‘NCM_COMPRESSION’ 456if((ret = deletefet_ret(NCM_COMPRESSION, nistcom))) ^ ~~~~~~ include/wsq/nistcom.h:69:27: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 69#define NCM_JPEGL_PREDICT "JPEGL_PREDICT" / [1..7] / ^ ~~~~~~ src/wsq/nistcom.cpp:460:28: note: in expansion of macro ‘NCM_JPEGL_PREDICT’ 460if((ret = deletefet_ret(NCM_JPEGL_PREDICT, nistcom))) ^ ~~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:465:28: note: in expansion of macro ‘NCM_HEADER’ 465if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))) ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int del_wsq_nistcom(NISTCOM)’: include/wsq/nistcom.h:67:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 67#define NCM_COMPRESSION "COMPRESSION" / NONE,JPEGB,JPEGL,WSQ / ^ ~~~~ src/wsq/nistcom.cpp:478:28: note: in expansion of macro ‘NCM_COMPRESSION’ 478if((ret = deletefet_ret(NCM_COMPRESSION, nistcom))) ^ ~~~~~~ include/wsq/nistcom.h:70:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 70#define NCM_WSQ_RATE "WSQ_BITRATE" / ex. .75,2.25 (-1.0 if unknown)/ ^ ~~~~ src/wsq/nistcom.cpp:482:28: note: in expansion of macro ‘NCM_WSQ_RATE’ 482if((ret = deletefet_ret(NCM_WSQ_RATE, nistcom))) ^ ~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:487:28: note: in expansion of macro ‘NCM_HEADER’ 487if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))) ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int del_jpegb_nistcom(NISTCOM)’: include/wsq/nistcom.h:67:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 67#define NCM_COMPRESSION "COMPRESSION" / NONE,JPEGB,JPEGL,WSQ / ^ ~~~~ src/wsq/nistcom.cpp:500:28: note: in expansion of macro ‘NCM_COMPRESSION’ 500if((ret = deletefet_ret(NCM_COMPRESSION, nistcom))) ^ ~~~~~~ include/wsq/nistcom.h:68:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 68#define NCM_JPEGB_QUAL "JPEGB_QUALITY" / [20..95] / ^ ~~~~~~ src/wsq/nistcom.cpp:504:28: note: in expansion of macro ‘NCM_JPEGB_QUAL’ 504if((ret = deletefet_ret(NCM_JPEGB_QUAL, nistcom))) ^ ~~~~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 58#define NCM_HEADER "NIST_COM" / manditory / ^ ~~~~~ src/wsq/nistcom.cpp:509:28: note: in expansion of macro ‘NCM_HEADER’ 509if((ret = updatefet_ret(NCM_HEADER, cbuff, nistcom))) ^ ~~~~~ src/wsq/nistcom.cpp: In function ‘int sd_ihead_to_nistcom(NISTCOM*, IHEAD, int)’: src/wsq/nistcom.cpp:541:21: error: invalid conversion from ‘char’ to ‘NISTCOM’ {aka ‘fetstruct’} [-fpermissive] 541*nistcom = '\0'; ^~~~ char In file included from src/wsq/nistcom.cpp:100: src/wsq/nistcom.cpp: In function ‘int sd4_ihead_to_nistcom(NISTCOM, IHEAD)’: include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 58 | #define NCM_HEADER "NIST_COM" / manditory / | ^
~~~~~ src/wsq/nistcom.cpp:587:28: note: in expansion of macro ‘NCM_HEADER’ 587 | if((ret = updatefet_ret(NCM_HEADER, "5", nistcom))) { | ^~~~~~ src/wsq/nistcom.cpp:587:40: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 587 | if((ret = updatefet_ret(NCM_HEADER, "5", nistcom))) { | ^~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:79:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 79 | #define NCM_SD_ID "SD_ID" / 4,9,10,14,18 / | ^~~ src/wsq/nistcom.cpp:594:28: note: in expansion of macro ‘NCM_SD_ID’ 594 | if((ret = updatefet_ret(NCM_SD_ID, "4", nistcom))) { | ^~~~~ src/wsq/nistcom.cpp:594:39: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 594 | if((ret = updatefet_ret(NCM_SD_ID, "4", nistcom))) { | ^~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:73:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 73 | #define NCM_HISTORY "HISTORY" / ex. SD historical data / | ^~~~~ src/wsq/nistcom.cpp:600:28: note: in expansion of macro ‘NCM_HISTORY’ 600 | if((ret = updatefet_ret(NCM_HISTORY, hst, nistcom))) { | ^~~include/wsq/nistcom.h:74:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 74 | #define NCM_FING_CLASS "FING_CLASS" / ex. A,L,R,S,T,W / | ^~~~ src/wsq/nistcom.cpp:612:28: note: in expansion of macro ‘NCM_FING_CLASS’ 612 | if((ret = updatefet_ret(NCM_FING_CLASS, cbuff, nistcom))) { | ^~~~~~ include/wsq/nistcom.h:75:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 75 | #define NCM_SEX "SEX" / m,f / | ^~~~~ src/wsq/nistcom.cpp:617:28: note: in expansion of macro ‘NCM_SEX’ 617 | if((ret = updatefet_ret(NCM_SEX, sex, nistcom))) { | ^~~ src/wsq/nistcom.cpp: In function ‘int sd9_10_14_ihead_to_nistcom(NISTCOM, IHEAD, int)’: include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 58 | #define NCM_HEADER "NIST_COM" / manditory / | ^~~~~~ src/wsq/nistcom.cpp:681:31: note: in expansion of macro ‘NCM_HEADER’ 681 | if((ret = updatefet_ret(NCM_HEADER, "7", nistcom))) { | ^~~~~~ src/wsq/nistcom.cpp:681:43: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 681 | if((ret = updatefet_ret(NCM_HEADER, "7", nistcom))) { | ^~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:62:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 62 | #define NCM_PPI "PPI" / -1 if unknown (manditory)/ | ^~~~~ src/wsq/nistcom.cpp:686:31: note: in expansion of macro ‘NCM_PPI’ 686 | if((ret = updatefet_ret(NCM_PPI, ihead->density, nistcom))) { | ^~~ include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 58 | #define NCM_HEADER "NIST_COM" / manditory / | ^~~~~~ src/wsq/nistcom.cpp:693:31: note: in expansion of macro ‘NCM_HEADER’ 693 | if((ret = updatefet_ret(NCM_HEADER, "6", nistcom))) { | ^~~~~~ src/wsq/nistcom.cpp:693:43: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 693 | if((ret = updatefet_ret(NCM_HEADER, "6", nistcom))) { | ^~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:79:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 79 | #define NCM_SD_ID "SD_ID" / 4,9,10,14,18 / | ^~~ src/wsq/nistcom.cpp:701:28: note: in expansion of macro ‘NCM_SD_ID’ 701 | if((ret = updatefet_ret(NCM_SD_ID, cbuff, nistcom))) { | ^~~~~ include/wsq/nistcom.h:73:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 73 | #define NCM_HISTORY "HISTORY" / ex. SD historical data / | ^~~~~ src/wsq/nistcom.cpp:707:28: note: in expansion of macro ‘NCM_HISTORY’ 707 | if((ret = updatefet_ret(NCM_HISTORY, hst, nistcom))) { | ^~~include/wsq/nistcom.h:74:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 74 | #define NCM_FING_CLASS "FING_CLASS" / ex. A,L,R,S,T,W / | ^~~~ src/wsq/nistcom.cpp:719:28: note: in expansion of macro ‘NCM_FING_CLASS’ 719 | if((ret = updatefet_ret(NCM_FING_CLASS, cbuff, nistcom))) { | ^~~~~~ include/wsq/nistcom.h:75:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 75 | #define NCM_SEX "SEX" / m,f / | ^~~~~ src/wsq/nistcom.cpp:724:28: note: in expansion of macro ‘NCM_SEX’ 724 | if((ret = updatefet_ret(NCM_SEX, sex, nistcom))) { | ^~~ include/wsq/nistcom.h:76:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 76 | #define NCM_SCAN_TYPE "SCAN_TYPE" / l,i */ | ^~~src/wsq/nistcom.cpp:729:28: note: in expansion of macro ‘NCM_SCAN_TYPE’ 729 | if((ret = updatefet_ret(NCM_SCAN_TYPE, ink_liv, nistcom))) { | ^~~~~ src/wsq/nistcom.cpp: In function ‘int sd18_ihead_to_nistcom(NISTCOM, IHEAD)’: include/wsq/nistcom.h:58:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 58 | #define NCM_HEADER "NIST_COM" / manditory / | ^~~~~~ src/wsq/nistcom.cpp:762:28: note: in expansion of macro ‘NCM_HEADER’ 762 | if((ret = updatefet_ret(NCM_HEADER, "6", nistcom))) { | ^~~~~~ src/wsq/nistcom.cpp:762:40: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 762 | if((ret = updatefet_ret(NCM_HEADER, "6", nistcom))) { | ^~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:79:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 79 | #define NCM_SD_ID "SD_ID" / 4,9,10,14,18 / | ^~~ src/wsq/nistcom.cpp:767:28: note: in expansion of macro ‘NCM_SD_ID’ 767 | if((ret = updatefet_ret(NCM_SD_ID, "18", nistcom))) { | ^~~~~ src/wsq/nistcom.cpp:767:39: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 767 | if((ret = updatefet_ret(NCM_SD_ID, "18", nistcom))) { | ^~~~ In file included from src/wsq/nistcom.cpp:100: include/wsq/nistcom.h:73:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 73 | #define NCM_HISTORY "HISTORY" / ex. SD historical data / | ^~~~~ src/wsq/nistcom.cpp:772:28: note: in expansion of macro ‘NCM_HISTORY’ 772 | if((ret = updatefet_ret(NCM_HISTORY, fname, nistcom))) { | ^~~include/wsq/nistcom.h:75:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 75 | #define NCM_SEX "SEX" / m,f / | ^~~~~ src/wsq/nistcom.cpp:777:28: note: in expansion of macro ‘NCM_SEX’ 777 | if((ret = updatefet_ret(NCM_SEX, sex, nistcom))) { | ^~~ include/wsq/nistcom.h:78:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 78 | #define NCM_AGE "AGE" | ^~~~~ src/wsq/nistcom.cpp:782:28: note: in expansion of macro ‘NCM_AGE’ 782 | if((ret = updatefet_ret(NCM_AGE, age, nistcom))) { | ^~~ include/wsq/nistcom.h:77:25: warning: ISO C++ forbids converting a string constant to ‘char’ [-Wwrite-strings] 77 | #define NCM_FACE_POS "FACE_POS" / f,p / | ^~~~~~ src/wsq/nistcom.cpp:788:28: note: in expansion of macro ‘NCM_FACE_POS’ 788 | if((ret = updatefet_ret(NCM_FACE_POS, fname, nistcom))) { | ^~~~ make[1]: [: src/wsq/nistcom.o] Error 1 make[1]: Leaving directory '/home/imanewbie/Source/NFIQ2/NFIQ2/NFIQ2Algorithm'
The assignments to
fet->names[idx]
from'\0'
(e.g. line 86) are weird.fet->names[idx]
is achar*
, not achar
.If the intention is to provide a null pointer constant, then
nullptr
should be used.If the intention is to set an empty string, this code doesn't do that and
""
should probably have been used instead.Also worth noting that this fails to build for at least one user, though I can't quite tell why. Moot if the code is changed anyway.