Repository: ocornut/imgui (language: rust)

Issue:
Wstack-protector
Add g++ flag `-Wstack-protector` and you get the warning:
 
```
imgui/imgui_draw.cpp: In member function ‘void ImDrawList::AddPolyline(const ImVec2*, int, ImU32, bool, float)’:
imgui/imgui_draw.cpp:669:6: warning: stack protector not protecting local variables: variable length buffer [-Wstack-protector]
 void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, bool closed, float thickness)

imgui/imgui_draw.cpp: In member function ‘void ImDrawList::AddConvexPolyFilled(const ImVec2*, int, ImU32)’:
imgui/imgui_draw.cpp:857:6: warning: stack protector not protecting local variables: variable length buffer [-Wstack-protector]
 void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
```


Discussion / hints:
We are going to silence this warning, since it doesn't appear to like `alloca()` with non-literal value.
It would be useful if we knew exactly in which version GCC introduced this. Unlike Clang, GCC has been wholly irresponsible adding overzealous warnings and no way to check if they are even supported by a given version.

You should consider not compiling third-party code with ultra agressive compile time options. If you compile third-party code you are trusting that code for a given purpose. No amount warning will ensure its safety. It is the role of each project developer to apply crazy warnings to their projet, not the role of the user.

(TL;DR; Don't compile third-party code the same way you compile your own code. May I suggest setting yourself up with a proper building system so you can adjust compile settings on a per-project/folder/library basis.)

This will effectively be a good evolution for my makefile to not compile third-parts with the same flags.
I tried with g++-5.5, g++-6.5.0 and g++-7.3.0 all produced this warning
Much appreciated! I suppose then we can try Nicolas’s PR as is without the version check!

Fix patch:
diff --git a/imgui_draw.cpp b/imgui_draw.cpp
index a3c48fc8a5aa..aeee7d3e9967 100644
--- a/imgui_draw.cpp
+++ b/imgui_draw.cpp
@@ -71,6 +71,7 @@ Index of this file:
 #pragma GCC diagnostic ignored "-Wunused-function"          // warning: 'xxxx' defined but not used
 #pragma GCC diagnostic ignored "-Wdouble-promotion"         // warning: implicit conversion from 'float' to 'double' when passing argument to function
 #pragma GCC diagnostic ignored "-Wconversion"               // warning: conversion to 'xxxx' from 'xxxx' may alter its value
+#pragma GCC diagnostic ignored "-Wstack-protector"          // warning: stack protector not protecting local variables: variable length buffer
 #if __GNUC__ >= 8
 #pragma GCC diagnostic ignored "-Wclass-memaccess"          // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
 #endif


Test patch: