Commit Graph

51 Commits

Author SHA1 Message Date
christos 88a527aa60 PR/47632: Supratim Chakraborty: Spelling Mistake for Variadic functions 2013-03-08 16:50:02 +00:00
riastradh 28dbe22a81 Elaborate and clarify rules about #include order.
ok christos
2012-06-27 22:04:02 +00:00
christos d98d733735 explain NULL casts 2011-09-01 09:33:01 +00:00
joerg 65a805f7d1 Prototyping main is silly and shouldn't be encouraged. 2011-08-27 17:48:11 +00:00
christos 7261fd134f make usage dead. 2010-10-30 20:12:32 +00:00
christos 5f696d700e Be explicit about sizeof(*var) being preferred over sizeof(type). 2010-04-24 00:54:07 +00:00
dholland 2c660aae28 Avoid trailing whitespace. It is definitely against the style rules. 2009-02-15 07:01:41 +00:00
jschauma 68b35bfb4d move punctuation of a complete sentence into its parens 2008-09-09 19:18:41 +00:00
lukem f606aab441 Remove the \n from the __COPYRIGHT example; what(1) stops extracting
at them, so we lose most of the message.
2008-07-20 00:51:19 +00:00
apb 75e064ab6b Don't mention <machine/int_fmtio.h>; code should just
include <inttypes.h> to get intmax_t, PRIdMAX, and friends.
2008-02-16 14:22:16 +00:00
plunky 713ac0bebd getopt uses : when an argument is expected 2007-09-20 18:27:17 +00:00
christos 99d821089c Fix reversed test and missing +; from Joerg Niendorf 2007-05-26 18:48:48 +00:00
darcy 14be1e0fea Add entry about making include files self-sufficient. 2007-04-13 13:23:58 +00:00
christos de3426b487 update brace comments to reflect current reality. 2006-11-02 22:44:41 +00:00
wiz 4ab9075a6b Mention the preferred option order in
getopt(), usage(), and man page.
Suggest describing newly added options in usage() and man page.
2006-02-25 11:07:19 +00:00
briggs ede55d75e5 Add some comments about using inttypes.h / int_fmtio.h macros.
Show use of PRIdMAX, PRIxMAX, PRId64, PRIx32, and refer to SCN*.
Inspired by comments from Roland Illig and others.
2005-08-25 17:51:58 +00:00
rillig 9e7b9d2566 Partly reverted my last change. I had forgotten that off_t is a signed
data type.
2005-08-20 16:17:36 +00:00
rillig 7b9a62a31f Don't cast unsigned values to long long. They might overflow. 2005-08-20 09:03:29 +00:00
rillig 410ba033c5 Use exit(EXIT_FAILURE) instead of exit(1). 2005-08-20 08:58:57 +00:00
junyoung 5f95214f7d More clarification on uintN_t. 2005-06-10 06:35:41 +00:00
christos 80cdc1a918 Make comment more specific. 2005-02-03 00:27:55 +00:00
christos b8b9d767c2 fix accidental join that made the comment look like functions that
return ``void *'' should not be cast'ed.
2005-02-02 23:33:42 +00:00
christos 7706d160ef Add missing (void) cast to printf return.
Prefer returning from main rather than calling exit.
2005-02-01 13:43:38 +00:00
wiz aef065eb63 Add uint32_t as example (so that it is implicitly clear we prefer the C99 types). 2005-01-03 13:59:40 +00:00
simonb 47d4b67a20 Use uintN_t in code example instead of u_intN_t. Agrees with current
standards (and more importantly Klaus too :-).
2003-09-27 21:17:31 +00:00
jmmv da0805ffe2 Recommend EXIT_SUCCESS and EXIT_FAILURE for exit status, instead of directly
using 0 and 1 values, respectively.
2003-08-05 13:26:13 +00:00
lukem 08b87159f0 check strtol for ERANGE overflow too... 2003-04-17 02:59:29 +00:00
lukem 6cbbfe4c9f There's no need anymore to protect __COPYRIGHT() and __RCSID() with:
#ifndef __lint
	...
	#endif
2003-03-10 03:50:38 +00:00
fvdl 1d6960703b Return value style update (no parentheses) 2003-03-04 14:22:15 +00:00
jhawk dcbacd486c Amend rev 1.21: there is insufficient concensus on #define<TAB>.
Permit any whitespace after #define, but mandate consistency of
TABs within a file.
2003-03-02 18:25:45 +00:00
jhawk e470466271 Clarify that macros should be #define<TAB>; it's important to specify this
in the actual document, just not in the cvs logs (cf. rev 1.15).
2003-02-23 14:58:50 +00:00
kleink 7ff4c19dee Inspired by rev. 1.18: consistency, pull in <assert.h> for _DIAGASSERT(). 2001-10-23 18:51:05 +00:00
kleink 04b133da92 As discussed with Luke, add a short _DIAGASSERT(3) example.
Fixes PR lib/14324.
2001-10-23 18:45:13 +00:00
cgd 00f68ab5c7 add include of stdlib.h, for use of setprogname() & getprogname() 2001-02-21 00:04:43 +00:00
cgd 2c1f7a6ee8 nuke __progname, suggest setprogname() and getprogname() 2001-02-19 22:46:47 +00:00
enami 04235cdc87 Fix typos. 2000-09-06 14:12:45 +00:00
lukem dc53b5b17e - fix spelo
- be consistent with #define<TAB> for macros
2000-09-04 08:01:16 +00:00
lukem 6243e0b38d add example on how to printf 64 bit quantities 2000-03-10 12:46:30 +00:00
lukem aa6dfe707c fix comment around CONSTCOND 2000-03-10 12:01:15 +00:00
lukem d56d7ced69 major overhaul:
* require ANSI not K&R for prototypes, stdargs, etc
* document current practice for
	- rcsids & copyright
	- header file inclusion protection
	- expressions, and multi-statement macros
	- enum & struct decls
	- empty and large statements
	- wrapping long lines, prototypes, function decls
2000-03-02 08:51:54 +00:00
abs cd59a419b6 Fix error in example - from VaX#n8 <vax@linkdead.paranoia.com> 1999-07-03 21:47:21 +00:00
scottr c9b4ff15c2 Add a pointer to the indent(1) profile, and a disclaimer regarding same. 1999-01-29 07:24:20 +00:00
lukem 5bd0869181 provide a better parenthesis example. from Brian Grayson in [misc/6714] 1999-01-20 23:13:54 +00:00
simonb 2a571c069b Function type declarations are manatory now. 1998-09-01 06:51:09 +00:00
enami 85da38999e Make C sentense end with `;'. 1998-02-09 06:58:39 +00:00
thorpej 7faf595cd3 RCS id police. Side effect: shows the RCS id style we prefer :-) 1996-08-30 17:43:09 +00:00
scottr 755cc6f914 getopt() returns -1 when the arg list is exhausted, not EOF. Ironic
that it should show up here...
1996-03-31 04:58:32 +00:00
briggs 6598f884fb Minor grammatical nit: "have too" -> "have to." 1995-04-10 22:28:18 +00:00
cgd 3d5d33d3c1 s/externs.h/extern.h/ 1994-12-19 14:14:40 +00:00
cgd c9621c279c style guide 1994-03-26 03:24:50 +00:00