Missing warning for C89 with integer literal too large for long

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-12282
    • Hide
      C2000_22.6.0.LTS
      C6000_8.3.0
      MSP430_20.2.0.LTS
      MSP430_21.6.0.LTS
      C2000_21.6.0.LTS
      PRU_2.3.0
      PRU_2.2.0
      ARM_20.2.0.LTS
      Show
      C2000_22.6.0.LTS C6000_8.3.0 MSP430_20.2.0.LTS MSP430_21.6.0.LTS C2000_21.6.0.LTS PRU_2.3.0 PRU_2.2.0 ARM_20.2.0.LTS
    • Hide
      C2000_25.3.0.LTS*
      MSP430_20.2.8.LTS*
      MSP430_NEXT*
      MSP430_21.6.2.LTS*
      C6000_8.5.0.LTS
      ARM_20.2.8.LTS*
      C2000_22.6.3.LTS*
      PRU_2.4.0*
      PRU_2.3.4*
      C6000_8.3.15*
      C2000_21.6.2.LTS*
      Show
      C2000_25.3.0.LTS* MSP430_20.2.8.LTS* MSP430_NEXT* MSP430_21.6.2.LTS* C6000_8.5.0.LTS ARM_20.2.8.LTS* C2000_22.6.3.LTS* PRU_2.4.0* PRU_2.3.4* C6000_8.3.15* C2000_21.6.2.LTS*
    • default
    • To avoid the issue use option --c99

      In C, the expression -2147483648L is not a constant. It is the unary negation of the constant 2147483648L. For a target where long is a 32-bit type, this constant is outside the range of values for a long, so this expression invokes undefined behavior for both C89 and C99. The compiler is not required to ensure that the expression (-2147483648L > 0) evaluates to 0, or even to successfully compile this expression at all. As a quality-of-implementation issue, the compiler may choose to emit a diagnostic indicating that this integer constant is out of range. This defect report states that the compiler fails to emit such a diagnostic in C89 mode, even though it does emit such a diagnostic in C99 mode.

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5573 - Missing warning for C89 with intege...
                SYNCHRONIZED
                • Last Sync Date: