[EXT_EP-10144] Including cmath causes remark: zero used for undefined preprocessing identifier "__STDC_VERSION__" Created: 23/Nov/20  Updated: 27/May/21  Resolved: 28/Dec/20

Status: Fixed
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: TI User Assignee: TI User
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-8389
Found In Release: C6000_8.3.0
MSP430_20.2.0.LTS
ARM_18.12.0.LTS
C2000_20.12.0.STS
C7000_2.0.0.STS*
ARM_20.2.0.LTS
C2000_20.2.0.LTS
C7000_1.4.0.LTS
MSP430_20.12.0.STS
MSP430_18.12.0.LTS
C2000_18.12.0.LTS
Fix In Release: ARM_20.2.5.LTS
MSP430_21.6.0.LTS
C2000_21.6.0.LTS
C7000_2.0.0.STS*
C7000_1.4.2.LTS
MSP430_18.12.8.LTS
C2000_20.2.5.LTS
C2000_18.12.8.LTS
ARM_18.12.8.LTS
MSP430_20.2.5.LTS
C6000_8.3.9
Affected Platform/Device: default
Workaround: Change header file lines identified in warning to begin with check that __STDC_VERSION__ is defined prior to checking its value:
#if defined(_STDC_VERSION__) && __STDC_VERSION__ >= ...

 Description   

Given a simple C++ source file with lines similar to ...

#include <cmath>
int a;

Build it with remarks enabled ...

% armcl --issue_remarks file.cpp
"C:\ti\compilers\ti-cgt-arm_18.12.4.LTS\include\math.h", line 96: remark: zero used for undefined preprocessing identifier "__STDC_VERSION__"
"C:\ti\compilers\ti-cgt-arm_18.12.4.LTS\include\math.h", line 110: remark: zero used for undefined preprocessing identifier "__STDC_VERSION__"

Those lines in math.h fail to anticipate that the code may be compiled as C++, and the predefined symbol _STDC_VERSION_ is not available.  They need to rewritten similar to this line in tgmath.h ...

#if (defined(_STDC_VERSION) && __STDC_VERSION_ >= 201112L)

 


Generated at Thu Apr 03 01:35:48 CDT 2025 using Jira 9.12.17#9120017-sha1:aba4002bcd633f188b6a4bb5dd8a0e1f20b79ee4.