language-c: Analysis and generation of C code

[ bsd3, language, library ] [ Propose Tags ]

Language C is a haskell library for the analysis and generation of C code. It features a complete, well tested parser and pretty printer for all of C99 and a large set of C11 and clang/GNU extensions.

[Skip to Readme]
Versions [RSS] [faq] 0.3.0, 0.3.1,, 0.3.2,, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.7, 0.5.0, 0.6, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.8.3, 0.9,
Change log ChangeLog
Dependencies array, base (==3.* || >=4.7 && <4.13), bytestring (>=0.9.0), containers (<0.6), deepseq (>= && <1.5), directory, filepath, ghc-prim (==0.2.*), pretty (<1.2.0), process, syb [details]
License BSD-3-Clause
Copyright LICENSE
Revised Revision 3 made by phadej at 2019-09-04T02:04:50Z
Category Language
Home page
Bug tracker
Source repo head: git clone
Uploaded by BenediktHuber at 2018-06-08T05:07:30Z
Distributions Arch:, Debian:0.8.1, Fedora:, FreeBSD:0.4.7, LTSHaskell:, NixOS:, Stackage:, openSUSE:0.9
Downloads 52076 total (425 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-06-08 [all 1 reports]



Manual Flags

Automatic Flags

Use ByteString as InputStream datatype


Data.Generics available in separate package.


Turn on all warnings for building (development)


Support IEC 60559 floating point extension (defines _Float128)


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for language-c-0.8.1

[back to package description]
= Language.C =

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


== Build and Install ==

cabal install

-- or --

runhaskell Setup.hs configure FLAGS
runhaskell Setup.hs build
runhaskell Setup.hs install

Provide the set of flags passing
to configure.

== Compatibility ==

Tested with GHC 7.8, 7.10, 8.0 and 8.2.
It is recommended to use the most recent platform release:

== C Language Compatibility ==

Currently unsupported C11 constructs:
 - static assertion 6.7.10 (_Static_assert)
 - generic selection (_Generic)
 - _Atomic, _Alignas, _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);

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

== Sources ==

see src/README

== Examples ==

A couple of small examples are available in /examples

== Testing ==

A couple of regression tests can be run via
> cd test/harness; make

For more tests, see test/README.