File: Compiler_Quirks.md

package info (click to toggle)
mpich 4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,184 kB
  • sloc: ansic: 1,040,629; cpp: 82,270; javascript: 40,763; perl: 27,933; python: 16,041; sh: 14,676; xml: 14,418; f90: 12,916; makefile: 9,270; fortran: 8,046; java: 4,635; asm: 324; ruby: 103; awk: 27; lisp: 19; php: 8; sed: 4
file content (120 lines) | stat: -rw-r--r-- 4,225 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
This page serves to document various bugs, quirks, extensions, and other
non-standards-conforming behavior of various compilers on various
platforms. It also documents whether or not the compiler supports some
or all of C99.

## GCC

Supports most of the actually useful pieces of C99 as far back as
GCC-3.0. Support is better in newer versions, although still not 100%
complete. See [the compatibility
page](http://gcc.gnu.org/c99status.html) for more information, including
supported features in versions as far back as 3.0.

### v4.3

Seems to be stricter about some warnings than previous versions of gcc.
*Need to elaborate on this.*

## GNU ld linker

### v2.15.92.0.2 20040927

Seems to have a bug where the -O2 default optimization (and even -O1)
fails.

## Intel Compiler

Reference: [official support
list](https://software.intel.com/en-us/articles/c99-support-in-intel-c-compiler).

Appears to support many C99 features at least as far back as v8,
most/all are definitely supported in v10 and later. In particular,
__VA_ARGS__ and snprintf are supported.

icc needs "`-diag-error 147`" in order to make `PAC_FUNC_NEEDS_DECL`
work correctly as of release 1.4.1p1.

## IBM XL Compiler (xlc)

### v9.0 - v13.x

Will display its man page when passed an option it doesn't understand,
including `--version`, `-v`, `-V`, and `--help`. This can lead to very
large `config.log` files when configure probes for the compiler type and
version information.

## Sun Studio Compiler

The Sun Studio 8
[documentation](http://docs.sun.com/source/817-5064/c99.app.html) claims
support for most relevant C99 features, such as variable argument list
macros. The current version as of this writing is Sun Studio 12 and it
claims to have full C99 support.

### Sun C 5.9 SunOS_sparc

Issues a warning when an invalid inline assembly instruction is given,
but finishes compiling (and reports success) omitting the assembly
instructions it couldn't understand. This means we really can't use
inline assembly instructions with this compiler because configure can't
determine which assembly instructions are valid.

## Microsoft Visual C Compiler

Seems the most useful information is in this [blog
post](https://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/).
Officially, Microsoft C compiler only supports C90 (which is essentially
the same as C89). It has some C99 or even C11 support, but there is no
plan for full C99 support.

Testing with VC++ 2010's `cl` (32-bit, version 16.00.xxxxx.xx):

  - \<stdint.h\> is supported.
  - \<stdbool.h\> and \<complex.h\> are not supported.
  - `__VA_ARGS__` is supported.
  - Declaring variables in the middle of a block is not supported.
  - `//` inline comment is supported.

## Portland Group Compiler

Appears to support C99 in some form at least as far back as v8 of the
compiler (has a -c99 switch). The docs for v9 claim *full* C99 support.

### v8.0.5

Supports gcc-style inline assembly in general, but is much touchier
about which register constraints are supported in which positions. If
you are ever writing inline assembly for PGI, be careful and see mpich
tickets  and  for the final resolution on these issues.

For inline assembly, pgcc interprets output parameters with the the "m"
constraint differently if the parameter is a pointer or an int. I filed
a ticket with PGI, and they said it'll be fixed in 9.0-1.

## HP aCC Compiler (HP-UX)

(based on [docs in a link that may not stay
accessible](http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=4b080f1bace021100f1bace02110275d6e10RCRD))

### v5

Some C99 support, although exactly what is available isn't clear from
the documentation and we don't have access to this compiler.

### v6

Adds support for

  - Flexible array member
  - Designated initializers
  - Empty macro arguments

## Pathscale Compiler

This compiler has been owned by Qlogic, SiCortex, and now Cray over the
years. It uses a front-end based on GCC so it generally has the same C99
compliance as the version of GCC on which your particular version is
based. Because GCC has had usable C99 support for quite a while now,
most versions of the Pathscale C compiler should also contain usable C99
support.