Skip to content

Commit

Permalink
Make declarations of "main" in examples consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafe Kettler authored and Joseph Myers committed Feb 18, 2012
1 parent 2ee633a commit 09c093b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 11 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2012-02-18 Rafe Kettler <rafe.kettler@gmail.com>

[BZ #13058]
* manual/examples/argp-ex1.c (main): Format definition in GNU
style.
* manual/examples/argp-ex2.c (main): Likewise.
* manual/examples/argp-ex3.c (main): Likewise.
* manual/examples/argp-ex4.c (main): Likewise.
* manual/examples/longopt.c (main): Use new-style prototype
definition.
* manual/examples/strncat.c (main): Specify return type and use
(void) for arguments.
* manual/examples/subopt.c (main): Use char **argv argument.

2012-02-17 Joseph Myers <joseph@codesourcery.com>

[BZ #5077]
Expand Down
5 changes: 3 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Version 2.16
* The following bugs are resolved with this release:

174, 350, 411, 3335, 4026, 4822, 5077, 5805, 6884, 6907, 9902, 10140,
10210, 11494, 12047, 13525, 13526, 13527, 13528, 13529, 13530, 13531,
13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13583, 13618
10210, 11494, 12047, 13058, 13525, 13526, 13527, 13528, 13529, 13530,
13531, 13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13583,
13618

* ISO C11 support:

Expand Down
3 changes: 2 additions & 1 deletion manual/examples/argp-ex1.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include <stdlib.h>
#include <argp.h>

int main (int argc, char **argv)
int
main (int argc, char **argv)
{
argp_parse (0, argc, argv, 0, 0, 0);
exit (0);
Expand Down
3 changes: 2 additions & 1 deletion manual/examples/argp-ex2.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ static char doc[] =
option will print out @code{argp_program_version}. */
static struct argp argp = { 0, 0, 0, doc };

int main (int argc, char **argv)
int
main (int argc, char **argv)
{
argp_parse (&argp, argc, argv, 0, 0, 0);
exit (0);
Expand Down
3 changes: 2 additions & 1 deletion manual/examples/argp-ex3.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ parse_opt (int key, char *arg, struct argp_state *state)
/* Our argp parser. */
static struct argp argp = { options, parse_opt, args_doc, doc };

int main (int argc, char **argv)
int
main (int argc, char **argv)
{
struct arguments arguments;

Expand Down
3 changes: 2 additions & 1 deletion manual/examples/argp-ex4.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ parse_opt (int key, char *arg, struct argp_state *state)
/* Our argp parser. */
static struct argp argp = { options, parse_opt, args_doc, doc };

int main (int argc, char **argv)
int
main (int argc, char **argv)
{
int i, j;
struct arguments arguments;
Expand Down
4 changes: 1 addition & 3 deletions manual/examples/longopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
static int verbose_flag;

int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int c;

Expand Down
3 changes: 2 additions & 1 deletion manual/examples/strncat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

static char buffer[SIZE];

main ()
int
main (void)
{
strncpy (buffer, "hello", SIZE);
puts (buffer);
Expand Down
2 changes: 1 addition & 1 deletion manual/examples/subopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const char *mount_opts[] =
};

int
main (int argc, char *argv[])
main (int argc, char **argv)
{
char *subopts, *value;
int opt;
Expand Down

0 comments on commit 09c093b

Please sign in to comment.