This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate 4 build-time warnings in timecheck.c.
authorJames E Keenan <jkeenan@cpan.org>
Tue, 27 Nov 2018 21:12:45 +0000 (16:12 -0500)
committerJames E Keenan <jkeenan@cpan.org>
Fri, 7 Dec 2018 23:09:23 +0000 (23:09 +0000)
commit252e731f408fa6f7a284ed879dee7a0d93156168
tree47f59a66cf67832b0d384193094f257703b1fc40
parent90c09c683be291d22d2f06a3d926b59dc5677958
Eliminate 4 build-time warnings in timecheck.c.

This commit suppresses output like this:

[Porting] 758 $ cc -O -o timecheck timecheck.c
timecheck.c: In function ‘gm_check’:
timecheck.c:37:36: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
      fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n",
                                ~~~~^
                                %12d
timecheck.c:39:3:
   tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
   ~~~~~~~~~~~~~~~~~~~
timecheck.c: In function ‘lt_check’:
timecheck.c:89:36: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
      fprintf (stderr, "%3d:%s: %12ld-%02d-%02d %02d:%02d:%02d\n",
                                ~~~~^
                                %12d
timecheck.c:91:3:
   tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
   ~~~~~~~~~~~~~~~~~~~
timecheck.c: In function ‘main’:
timecheck.c:130:21: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration]
     if (argc > 1 && strcmp (argv[1], "-v") == 0) opt_v++;
                     ^~~~~~
timecheck.c:139:32: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=]
     printf ("Sizeof time_t = %ld\n", (i = sizeof (time_t)));
                              ~~^     ~~~~~~~~~~~~~~~~~~~~~
                              %d
Porting/timecheck.c