I am wondering about the use of -O0,-O1 and -g for enabling debug symbols in a lib. Some suggest to use -O0 to enable debug symbols and some suggest to use -g.
So what is the actual difference between -g and -O0 and what is the difference between -01 and -O0 and which is best to use.