Closed jaskij closed 4 months ago
Review changes with SemanticDiff.
Explaining the pragmas:
#pragma GCC diagnostic push // store current diagnostics setup
#pragma GCC diagnostic ignored "-Wc++20-compat" // disable C++20 compat warning
// code goes here
#pragma GCC diagnostic pop // resture previously stored diagnostic setup
I went with the pragma approach because this is the only place which causes the error
To control warnings so far I've created headers that enable and disable them.
See example include/etl/private/diagnostic_array_bounds_push.h
and include/etl/private/diagnostic_pop.h
Example of use...
#include "etl/private/diagnostic_array_bounds_push.h"
position1 = compare_text.find_last_not_of(STR('C'), 100);
position2 = text.find_last_not_of(STR('C'), 100);
CHECK_EQUAL(position1, position2);
#include "etl/private/diagnostic_pop.h"
Thank you for pointing that out, moved the diagnostics to their own file.
Fix #906