Skip to main content
Clifford1
Associate III
April 20, 2010
Question

Typedef bool C99 conflict in STM32F10x StdPeriph Lib V3.x.x

  • April 20, 2010
  • 2 replies
  • 803 views
Posted on April 20, 2010 at 12:32

Typedef bool C99 conflict in STM32F10x StdPeriph Lib V3.x.x

    This topic has been closed for replies.

    2 replies

    Andrew Neil
    Super User
    May 17, 2011
    Posted on May 17, 2011 at 13:48

    To be general, the solution would also have to cater for non-C99 compilers (which, I think, is the majority of embedded compilers?)

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Clifford1
    Clifford1Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:48

    All of GCC, Keil/ARM, and IAR support C99 at least in so far as having <stdbool.h> and <stdint.h> headers, and these are the compilers directly supported by ST's peripheral and CMSIS libraries. 

    Moreover the library already uses <stdint.h> which is a C99 header also. 

    At least a subset of C99 is supported by most compilers, and provision of these headers requires no modification to the compiler (although the stdbool.h would not have an intrinsic underlying _Bool type).  For example, I use a third-party implementation of these for VC++ 2008 for compatibility which does not otherwise provide them).

    Even if I were not using a C99 compiler, the unnecessary incompatibility would be better avoided.

    My real question is how best to report the issue to ST so that it may be improved?  I realise that I can fix it myself, but adding modifications to the library makes it cumbersome and error prone integrating future updates.