Can someone tell what are the compilation flags that you use in Windows-10 and also the compiler which you use. (The main thing I want is how to catch out of arrays accesses and similar stuff and catching exceptions..). You may also share your IDE if you want . Thanks Friends..
I have been using this, pretty useful, you should check it out (although some flags might not be compatible with Windows).
I have also found this and this, haven't tried those myself but I think you should check those out as well.
thanks this worked
it was finding the out-of bounds errors
I use geany in linux and here are my two compile commands:
g++ -std=c++11 -O2 -Wall -Wextra -Wno-unused-result -Wno-char-subscripts -Wshadow -Wfloat-equal -Wconversion -Wformat-signedness -Wvla -Wduplicated-cond -Wlogical-op -Wredundant-decls -o "%e" "%f"
g++ -std=c++11 -O0 -Wall -Wextra -Wno-unused-result -Wno-char-subscripts -Wshadow -Wfloat-equal -Wconversion -Wformat-signedness -Wvla -Wduplicated-cond -Wlogical-op -Wredundant-decls -ggdb3 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_FORTIFY_SOURCE=2 -fsanitize=undefined,address,float-divide-by-zero,float-cast-overflow -fno-omit-frame-pointer -fno-optimize-sibling-calls -fstack-protector-all -fno-sanitize-recover=all -o "%e" "%f"
yeah I also use similar ones in geany in linux.
But I also wanted to configure my windows for coding and when I tried to use fsanitize flags in windows it gave some errors(some lubsan ... ) for which i didn't find a way to get rid of them.
Edit: Sorry You are right . For a normal C-Style Array it is not able to find the Error. So , what is the way of catching runtime out of bound errors in Windows?
I use g++ version 9.2.0 and I use these compilation flags
But I don't know why
-fsanitize
does not work.