Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. error: ignoring return value of function declared with 'nodiscard' attributes
Forum Updated to NodeBB v4.3 + New Features

error: ignoring return value of function declared with 'nodiscard' attributes

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 4 Posters 1.7k Views
  • 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.
  • F Offline
    F Offline
    Firas Alaammar
    wrote on 19 Aug 2021, 20:14 last edited by
    #1

    I'm getting this error while I'm trying to translate my app :
    error: ignoring return value of function declared with 'nodiscard' attributes !IMG_7321.jpg and the translation doesn't work, can anybody please help ?

    J 1 Reply Last reply 19 Aug 2021, 20:44
    0
    • F Firas Alaammar
      19 Aug 2021, 20:14

      I'm getting this error while I'm trying to translate my app :
      error: ignoring return value of function declared with 'nodiscard' attributes !IMG_7321.jpg and the translation doesn't work, can anybody please help ?

      J Offline
      J Offline
      JonB
      wrote on 19 Aug 2021, 20:44 last edited by
      #2

      @Firas-Alaammar
      That may be a warning only in the editor's code model, not when you actually compile?

      Anyway, if you want to get rid of it QTranslator::load() returns a bool, my guess is if you assign/test it (which really you ought do here anyway) that would get rid of this warning?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sumit.chatterjee
        wrote on 6 Nov 2023, 07:10 last edited by
        #3

        I can see that you are using the use case from this https://www.youtube.com/watch?v=In5QH_ZrDJE youtube link which works fine. But i see the same warning and even there is no output in the application for language switch which i am still confused about.

        J 1 Reply Last reply 6 Nov 2023, 07:13
        0
        • S sumit.chatterjee
          6 Nov 2023, 07:10

          I can see that you are using the use case from this https://www.youtube.com/watch?v=In5QH_ZrDJE youtube link which works fine. But i see the same warning and even there is no output in the application for language switch which i am still confused about.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 6 Nov 2023, 07:13 last edited by
          #4

          @sumit-chatterjee @JonB Explained what needs to be changed to get rid of this error - did you do that?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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