ImGuiColorTextEdit icon indicating copy to clipboard operation
ImGuiColorTextEdit copied to clipboard

warning produced by gcc

Open onqtam opened this issue 8 years ago • 2 comments

The following warning is produced from the header with gcc 7:

TextEditor.h:125:30: warning: 'TextEditor::Glyph::mColorIndex' is too small to hold all values of 'enum class TextEditor::PaletteIndex'
   PaletteIndex mColorIndex : 7;

on the default warning level - and it cannot be easily silenced (without disabling all warnings with -w)

onqtam avatar Jan 08 '18 22:01 onqtam

Hm... GCC probably checks against the underlying type, not the actual values.... I removed the type specifier from the enum class declaration. Can you please check whether the warning is gone now?

BalazsJako avatar Feb 20 '18 05:02 BalazsJako

nope - I still get the warning. What worked for removing it was:

  • to switch from PaletteIndex mColorIndex : 7; to int mColorIndex : 7;
  • to switch from enum class PaletteIndex to enum PaletteIndex
  • to switch from String and Identifier to String2 and Identifier2

But that is ugly and not type safe...

There is another one:

if (line >= mLines.size())

TextEditor.cpp(103): warning C4018: '>=': signed/unsigned mismatch

onqtam avatar Feb 20 '18 08:02 onqtam