Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to resolve below warning at runtime ?
Forum Updated to NodeBB v4.3 + New Features

How to resolve below warning at runtime ?

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 799 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #1

    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 ?

    SGaistS KroMignonK 2 Replies Last reply
    0
    • SGaistS SGaist

      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 ?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #8

      @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 try

      pMainApp.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);
      
      1 Reply Last reply
      2
      • Q Qt embedded developer

        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 ?

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        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 ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        0
        • Q Qt embedded developer

          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 ?

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by
          #3

          @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);

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          Q 1 Reply Last reply
          2
          • KroMignonK KroMignon

            @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);

            Q Offline
            Q Offline
            Qt embedded developer
            wrote on last edited by
            #4

            @KroMignon yes

            1 Reply Last reply
            0
            • SGaistS SGaist

              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 ?

              Q Offline
              Q Offline
              Qt embedded developer
              wrote on last edited by Qt embedded developer
              #5

              @SGaist i just want to send " pkill florence " like command using macro

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #6

                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 ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                Q JonBJ 2 Replies Last reply
                0
                • SGaistS SGaist

                  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 ?

                  Q Offline
                  Q Offline
                  Qt embedded developer
                  wrote on last edited by
                  #7

                  @SGaist #define KEYBOARD_CMD "florence"

                  1 Reply Last reply
                  0
                  • SGaistS SGaist

                    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 ?

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #8

                    @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 try

                    pMainApp.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);
                    
                    1 Reply Last reply
                    2

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved