How to resolve below warning at runtime ?
-
i have used below macro in my code.
#define KEYBOARD_CMD "florence"which give me below warning
warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
pMainApp.ObjSysOperation.SendSystemCommand(" pkill "KEYBOARD_CMD, sResponse, sError);How to resolve this warning ?
-
I suppose that KEYBOARD_CMD is a define containing
florence
?If so, are you currently expecting that
" pkill "florence
shall be a valid way to build a string ?@SGaist said in How to resolve below warning at runtime ?:
I suppose that KEYBOARD_CMD is a define containing florence ?
Seemingly not, as the OP originally showed
#define KEYBOARD_CMD "florence"
i.e. with the quotes.
@Qt-embedded-developer
@KroMignon asked you to trypMainApp.ObjSysOperation.SendSystemCommand(" pkill " KEYBOARD_CMD, sResponse, sError);
Note the space before
KEYBOARD_CMD
.You claimed "yes" you had tried this. Did you actually do so? Please now show this line as you have it in your code together with a copy-paste of the C++ warning, which would now be:
warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] pMainApp.ObjSysOperation.SendSystemCommand(" pkill " KEYBOARD_CMD, sResponse, sError);
-
i have used below macro in my code.
#define KEYBOARD_CMD "florence"which give me below warning
warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
pMainApp.ObjSysOperation.SendSystemCommand(" pkill "KEYBOARD_CMD, sResponse, sError);How to resolve this warning ?
Hi,
@Qt-embedded-developer said in How to resolve below warning at runtime ?:
" pkill "KEYBOARD_CMD
What is that piece of code supposed to do ?
Isn't there a comma missing ? -
i have used below macro in my code.
#define KEYBOARD_CMD "florence"which give me below warning
warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
pMainApp.ObjSysOperation.SendSystemCommand(" pkill "KEYBOARD_CMD, sResponse, sError);How to resolve this warning ?
@Qt-embedded-developer said in How to resolve below warning at runtime ?:
pMainApp.ObjSysOperation.SendSystemCommand(" pkill "KEYBOARD_CMD, sResponse, sError);
Have you tried to insert the space, as requested, like this?
pMainApp.ObjSysOperation.SendSystemCommand(" pkill " KEYBOARD_CMD, sResponse, sError);
-
@Qt-embedded-developer said in How to resolve below warning at runtime ?:
pMainApp.ObjSysOperation.SendSystemCommand(" pkill "KEYBOARD_CMD, sResponse, sError);
Have you tried to insert the space, as requested, like this?
pMainApp.ObjSysOperation.SendSystemCommand(" pkill " KEYBOARD_CMD, sResponse, sError);
@KroMignon yes
-
Hi,
@Qt-embedded-developer said in How to resolve below warning at runtime ?:
" pkill "KEYBOARD_CMD
What is that piece of code supposed to do ?
Isn't there a comma missing ?@SGaist i just want to send " pkill florence " like command using macro
-
I suppose that KEYBOARD_CMD is a define containing
florence
?If so, are you currently expecting that
" pkill "florence
shall be a valid way to build a string ? -
I suppose that KEYBOARD_CMD is a define containing
florence
?If so, are you currently expecting that
" pkill "florence
shall be a valid way to build a string ?@SGaist #define KEYBOARD_CMD "florence"
-
I suppose that KEYBOARD_CMD is a define containing
florence
?If so, are you currently expecting that
" pkill "florence
shall be a valid way to build a string ?@SGaist said in How to resolve below warning at runtime ?:
I suppose that KEYBOARD_CMD is a define containing florence ?
Seemingly not, as the OP originally showed
#define KEYBOARD_CMD "florence"
i.e. with the quotes.
@Qt-embedded-developer
@KroMignon asked you to trypMainApp.ObjSysOperation.SendSystemCommand(" pkill " KEYBOARD_CMD, sResponse, sError);
Note the space before
KEYBOARD_CMD
.You claimed "yes" you had tried this. Did you actually do so? Please now show this line as you have it in your code together with a copy-paste of the C++ warning, which would now be:
warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] pMainApp.ObjSysOperation.SendSystemCommand(" pkill " KEYBOARD_CMD, sResponse, sError);