10

It is in my Eclipse Problems view. The code compiles fine but there is an error saying "required from here", pointing to some boost header file and to the line state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);

I don't like to have errors or warnings. Does anybody know what that is?

ecatmur
  • 152,476
  • 27
  • 293
  • 366
Etherealone
  • 3,488
  • 2
  • 37
  • 56
  • 2
    It's only a part of the error message, telling you where the error is coming from. – jrok Feb 08 '13 at 19:21
  • It usually says *something very long* and adds "required from here" part to help figure out what code *caused* that *something* to happen. Showing the rest of the message might help. – Anton Kovalenko Feb 08 '13 at 19:22
  • 1
    It is the only thing in errors section and the code compiles fine. There are only warnings after it in console output. – Etherealone Feb 08 '13 at 19:30
  • 2
    Eclipse is taking part of a warning and displaying it in the error section. Get rid of all your warnings and it should go away. – ecatmur Feb 08 '13 at 19:47
  • You should always fix issues from the first message to the last (as produced by the compiler, not as digested and spewed by the IDE). Take a look at the output from the compiler and it will become simple(/simpleR) to understand. – David Rodríguez - dribeas Feb 08 '13 at 20:58

2 Answers2

6

This behavior is a bug of eclipse CDT Error Parser: https://bugs.eclipse.org/bugs/show_bug.cgi?id=108720 Actually this error is a warning and boost is responsible for it. You can disable this special kind of warnings to omit them.

gnod
  • 407
  • 3
  • 9
  • how to disable it..I get this bug every time I run the NDK in Eclipse – Shravan Dec 15 '14 at 15:57
  • 1
    Depending on your warning that is coursing the problem you can disable it with `-w`. See [gcc warning doc](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html) on how to disable warnings. – gnod Jan 15 '15 at 10:05
0

Did you actually returned? and check the types &state new_state and old_state. if you used: int new_state; and in the function compare_exchange(size_t &state, size_t new_state, size_t old_state) You get this error, well i did :)

          state_data const current_state = interlocked_compare_exchange(&state,new_state,old_state);

add:

      return new_state;
Andre
  • 172
  • 2
  • 8