When I copy an address in a buffer to another location in the same buffer the application crashes. It logs: "detected source and destination buffer overlap" EXC_BAD_INSTRUCTION (code=EXCI386_INVOP, subcode=0x0)
for example
char myBuffer[1024];
while myBuffer[0] == ' '
strcpy(myBuffer, myBuffer + 1); or alternately
strcpy(myBuffer, &myBuffer[1]);
This should strip leading spaces from a buffer of text. This is perfectly legitimate in all versions of C and has been OK in all versions of XCode and all C compilers since C was invented.
This is in XCode 8.3.3 (8E3004b)
Seriously Apple, you just broke hundreds of millions of lines of source code. Is there any way for me to fix this other than re-writing the text editing code in thousands of appplications and hundreds of millions of lines of source code?
Can I use some other compiler?
The Code Analyser doesn't find these Can I get it to?
Can I fix the build settings so the LLVM compiler won't break this?
C IS NOT Swift. Apple doesn't need to save me from myself. PLEASE HELP ME!