summaryrefslogtreecommitdiff
path: root/mk/help/c.help
blob: d2a9387281c4b68c2aa9e5ff0f5975839228f62e (plain)
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
# $NetBSD: c.help,v 1.3 2013/08/31 20:44:43 rillig Exp $

# This file contains typical error messages from C compilers and
# instructions how to fix them properly.

# === Invalid lvalue in increment ===
#
# Once upon a time, it was possible to say "((int)foo)++", which treats
# foo as if it has type "int", and increments it. With gcc4,
# this no longer works, and now you have to say "foo = (int)foo + 1".
# This is because a type cast now results only in an rvalue (which is an
# expression that doesn't have a location in memory), not in an lvalue
# (which is an expression that does have a location).
#
# This becomes more complicated in macros that access datastructures,
# which involves much pointer arithmetics. A popular example is obstack,
# a collection of "object stack macros". A patch for fixing that is in
# devel/coconut/patches/patch-ab revision 1.1.
#
# Keywords: C lvalue increment obstack obstack_ptr_grow

# === The __STDC__ macro ===
#
# If this macro is defined to 1, the C compiler implements
# ISO/IEC 9899:1990 (also known as C90), or a later version of that
# standard.
#
# When using the Sun C compiler, there are three possibilities for the
# __STDC__ macro:
#
# 1. In K&R mode (-Xt), __STDC__ is undefined.
# 2. In default mode (-Xa), __STDC__ is defined and has the value 0.
# 3. In conformance mode (-Xc), __STDC__ is defined and has the value 1.
#
# Keywords: __STDC__ sunpro