This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
There seems to be a small hole in the type checking whereby using the max() macro (from the gcc Typeof docs) results in a remark about signed/unsigned comparison. Only line 51 is flagged.
#include <stdint.h> #define max(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a > _b ? _a : _b; }) typedef enum { AE0 = 0, AE1 = 1 } AnonymousEnumeration_t; typedef enum NamedEnumeration_e { NE0, NE1 } NamedEnumeration_t; enum PostNamedEnumeration_e { PNE0, PNE1 }; typedef enum PostNamedEnumeration_e PostNamedEnumeration_t; AnonymousEnumeration_t AEa[3] = {}; int f() { uint16_t x = 5; __typeof__(x) y = x; __typeof__(x) z = max(x, y); AnonymousEnumeration_t a = max(AE0, AE0); AnonymousEnumeration_t b = max(AE0, AE1); AnonymousEnumeration_t c = max(AE0, AE0); __typeof__(c) d = max(AE0, AE1); AnonymousEnumeration_t e = AE0; __typeof__(e) f = e; __typeof__(e) g = max(e, f); AnonymousEnumeration_t h = max(AEa[0], AEa[1]); AnonymousEnumeration_t i = AE1; AnonymousEnumeration_t j = max(i, AEa[1]); // /opt/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.2.LTS/bin/cl2000 --include_path='/opt/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.2.LTS/include' --issue_remarks --display_error_number test.c // "test.c", line 51: remark #2142-D: comparison between signed and unsigned operands AnonymousEnumeration_t k = max(AE1, AEa[1]); __typeof__(AEa[1]) l = AEa[1]; AnonymousEnumeration_t m = max(l, AEa[1]); return x + y + z + a + b + c + d + e + f + g + h + i + j + k + l + m; }
(edit: Sorry, the original file above was a mixed run with the 18.1.2 compiler but the 18.1.1 include path. From what I saw it was the same in both 18.1.1 and 18.1.2. For completeness, I have updated it to be a copy run with 18.1.2 compiler and include path.)
Thank you for reporting this problem, and submitting a concise test case. I can reproduce the same diagnostic. It appears this diagnostic is incorrect. I filed CODEGEN-4895 in the SDOWP system to have this investigated. You are welcome to follow it with the SDOWP link below in my signature.
Thanks and regards,
-George
I get the same thing. I have notified the relevant team about the problem. Sorry about that.
Thanks and regards,
-George
I am able to see the issue on SDOWP now, thanks. Is it possible to subscribe to that for updates? Or should I expect something to be mentioned here when the fix is complete?
Cheers,
-kyle
Kyle Altendorf said:Is it possible to subscribe to that for updates?
Unfortunately, no.
Kyle Altendorf said:Or should I expect something to be mentioned here when the fix is complete?
That usually happens. However, I hate to admit this step is not automated. And it does get overlooked from time to time.
Thanks and regards,
-George