diff options
author | rillig <rillig> | 2008-01-10 02:34:09 +0000 |
---|---|---|
committer | rillig <rillig> | 2008-01-10 02:34:09 +0000 |
commit | 032cd66b4166aa036a648b6214d725fc44d8b01a (patch) | |
tree | fc9538a313f2c943a0bd5594ec8c9406f531ab64 | |
parent | 560261115b90f3ef7f7c92c74aaa2ae1535db271 (diff) | |
download | pkgsrc-032cd66b4166aa036a648b6214d725fc44d8b01a.tar.gz |
Explained the difference between an lvalue and an rvalue.
Documented the __STDC__ macro, especially Sun's implementation.
-rw-r--r-- | mk/help/c.help | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/mk/help/c.help b/mk/help/c.help index a8d37b2226a..794963197ea 100644 --- a/mk/help/c.help +++ b/mk/help/c.help @@ -1,12 +1,16 @@ -# $NetBSD: c.help,v 1.1 2008/01/06 19:13:31 rillig Exp $ +# $NetBSD: c.help,v 1.2 2008/01/10 02:34:09 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)++". With gcc4, +# 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, @@ -14,3 +18,18 @@ # 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__ |