#156312 - Quirky - Thu May 08, 2008 8:58 pm
Anyone know if this is a "feature" of gcc 4.3? It happens with DKA r22 and this code:
This is a bit daft - std::find should work with normal C arrays too. Compiling with -O1 "fixes" the problem.
Code: |
#include <algorithm> const static int COUNT(8); unsigned char vals[COUNT] = {0}; bool doStuff(unsigned char a) { unsigned char *begin = vals; unsigned char *end = (vals+COUNT); return std::find(begin, end, a) != end; } /* Compiled with these flags: $DEVKITARM/bin/arm-eabi-g++ -c -O2 -Wall fn.cpp -o fn.o */ |
This is a bit daft - std::find should work with normal C arrays too. Compiling with -O1 "fixes" the problem.