Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10367

math.h does not work with -std=c89 or c90 or gnu90

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • Code Generation Tools
    • CODEGEN-8955
    • Hide
      ARMCLANG_4.0.0.LTS
      ARMCLANG_2.1.3.LTS
      ARMCLANG_3.2.2.LTS
      Show
      ARMCLANG_4.0.0.LTS ARMCLANG_2.1.3.LTS ARMCLANG_3.2.2.LTS
    • Hide
      ARMCLANG_4.0.1.LTS*
      ARMCLANG_3.2.3.LTS*
      ARMCLANG_2.1.4.LTS*
      Show
      ARMCLANG_4.0.1.LTS* ARMCLANG_3.2.3.LTS* ARMCLANG_2.1.4.LTS*
    • default

      The attached test case is a simple program with two C files that each #include <math.h>.

      A minimal build works fine ...

      % tiarmclang -mcpu=cortex-m0 main.c test_func.c -Wl,-c
      

      Add the option -std=c89 ...

      % tiarmclang -mcpu=cortex-m0 -std=c89 main.c test_func.c -Wl,-c
      error: symbol "__fpclassify" redefined: first defined in
         "C:\Users\name\AppData\Local\Temp\main-732cf4.o"; redefined in
         "C:\Users\name\AppData\Local\Temp\test_func-179c46.o"
      error: symbol "__fpclassifyf" redefined: first defined in
         "C:\Users\name\AppData\Local\Temp\main-732cf4.o"; redefined in
         "C:\Users\name\AppData\Local\Temp\test_func-179c46.o"
      
      <Many similar errors skipped over>
      
      error: errors encountered during linking; "a.out" not built
      tiarmclang: error: tiarmlnk command failed with exit code 1 (use -v to see invocation)
      

      A similar result is seen with -std=c90 or -std=gnu90.

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

              Created:
              Updated: