Linguofreak
Well-known member
Does anyone know how to get gcc to output the actual numerical value it's evaluating for a "duplicate case value" error?
I've got a whole bunch of #defines establishing compile time constants that are being bitwise logicked around into other compile time constants, and somehow a bit is being masked that shouldn't be and that's causing two values that are supposed to be separate to collide in a case statement. In trying to debug it, I can get the preprocessor to emit the full final string that the compiler is receiving for each of the relevant cases, but it looks like it should evaluate to separate values, and the preprocessor, of course, isn't doing any math, it's just doing string manipulation, and the compiler is only telling me that the values are duplicates, and the contents of the relevant lines of source, not what it finally evaluated them to. I can't find the right search terms to get Google to cough up any relevant gcc options, and the options section of the gcc manpage is a wall of text.
I've got a whole bunch of #defines establishing compile time constants that are being bitwise logicked around into other compile time constants, and somehow a bit is being masked that shouldn't be and that's causing two values that are supposed to be separate to collide in a case statement. In trying to debug it, I can get the preprocessor to emit the full final string that the compiler is receiving for each of the relevant cases, but it looks like it should evaluate to separate values, and the preprocessor, of course, isn't doing any math, it's just doing string manipulation, and the compiler is only telling me that the values are duplicates, and the contents of the relevant lines of source, not what it finally evaluated them to. I can't find the right search terms to get Google to cough up any relevant gcc options, and the options section of the gcc manpage is a wall of text.