About

Metadata

  • Last updated , by Bodigrim
  • License BSD-3-Clause
  • Maintained by: language.c@monoid.al

  • Lottery factor: 1

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.10.3
  3. 9.8.4
  4. 9.6.7
  5. 9.4.8
  6. 9.2.8
  7. 9.0.2
  8. 8.10.7
  9. 8.8.4
  10. 8.6.5
  11. 8.4.4
  12. 8.2.2
  13. 8.0.2

Package Flags

Use the -f option with cabal commands to enable flags

    usebytestrings (on by default)

    Use ByteString as InputStream datatype

    iecfpextension (on by default)

    Support IEC 60559 floating point extension (defines _Float128)

Readme

Language.C

Language.C is a parser and pretty-printer framework for C11 and the extensions of gcc.

See http://visq.github.io/language-c/

C Language Compatibility

language-c has no comprehensive C23 support yet, but supports

  • the bool keyword

Currently unsupported C11 constructs:

  • static assertion 6.7.10 (_Static_assert)
  • generic selection 6.5.1.1 (_Generic)
  • _Atomic, _Thread_local
  • Universal character names

Currently unsupported GNU C extensions:

  • __auto_type
  • __builtin_offsetof char a[__builtin_offsetof (struct S, sa->f)
  • _Decimal32
  • Extended assembler __asm__ __volatile__ ("" : : : ); __asm__ goto ("" : : : : label);
  • __attribute__((packed)): types featuring this attribute may have an incorrect size or alignment calculated.
IEC 60559:

Since language-c-0.8, extended floating point types are supported (gcc 7 feature). Package maintainers may decide to disable these types (flag iecFpExtension) to work around the fact that the _Float128 type is redefined by glibc >= 2.26 if gcc < 7 is used for preprocessing:

  /* The type _Float128 exists only since GCC 7.0.  */
  # if !__GNUC_PREREQ (7, 0) || defined __cplusplus
  typedef __float128 _Float128;
  # endif

Examples

A couple of small examples are available in examples.

Testing

See test/README.