Skip to content

Fails to build with GCC 14: "adjtimex.c: In function 'valid_system_rate': adjtimex.c:1632:24: error: passing argument 1 of 'ctime' from incompatible pointer type [-Wincompatible-pointer-types]" #6

Description

@ernsteiswuerfel

At building 1.29 (Gentoo downstream bug report: https://bugs.gentoo.org/922489) and also at building from git-master with GCC 14 I get:

cc -g -O2 -Wall -c mat.c
cc -g -O2 -Wall -I. -DVERSION=\"1.29\" -o adjtimex  \
	 adjtimex.c mat.o -lm
adjtimex.c: In function 'cmos_read_time':
adjtimex.c:923:36: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Wformat=]
  923 |     printf ("CMOS time %s (%s) = %ld\n", asctime (&tm),
      |                                  ~~^
      |                                    |
      |                                    long int
      |                                  %lld
......
  927 |             cmos_time);
      |             ~~~~~~~~~               
      |             |
      |             time_t {aka long long int}
adjtimex.c:959:40: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'time_t' {aka 'long long int'} [-Wformat=]
  959 |           printf("WARNING: CMOS time %ld differs from system time %ld by %3.2f hours\n",
      |                                      ~~^
      |                                        |
      |                                        long int
      |                                      %lld
  960 |                  cmos_time, now.tv_sec, (summertime_correction)/3600.);
      |                  ~~~~~~~~~              
      |                  |
      |                  time_t {aka long long int}
adjtimex.c:959:69: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'time_t' {aka 'long long int'} [-Wformat=]
  959 |           printf("WARNING: CMOS time %ld differs from system time %ld by %3.2f hours\n",
      |                                                                   ~~^
      |                                                                     |
      |                                                                     long int
      |                                                                   %lld
  960 |                  cmos_time, now.tv_sec, (summertime_correction)/3600.);
      |                             ~~~~~~~~~~                               
      |                                |
      |                                time_t {aka long long int}
adjtimex.c:729:7: warning: variable 'saveerr' set but not used [-Wunused-but-set-variable]
  729 |   int saveerr;
      |       ^~~~~~~
adjtimex.c: In function 'log_times':
adjtimex.c:1339:10: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
 1339 |   int n, ret;
      |          ^~~
adjtimex.c:1338:8: warning: variable 'ch' set but not used [-Wunused-but-set-variable]
 1338 |   char ch, buf[64], *s;
      |        ^~
adjtimex.c: In function 'valid_system_rate':
adjtimex.c:1632:24: error: passing argument 1 of 'ctime' from incompatible pointer type [-Wincompatible-pointer-types]
 1632 |                  ctime(&pca->ca_adj_time));
      |                        ^~~~~~~~~~~~~~~~~
      |                        |
      |                        long int *
In file included from adjtimex.c:33:
/usr/include/time.h:62:14: note: expected 'const time_t *' {aka 'const long long int *'} but argument is of type 'long int *'
   62 | char *ctime (const time_t *);
      |              ^~~~~~~~~~~~~~
make: *** [Makefile:38: adjtimex] Error 1

Building was done on my Talos II on my ppc32/musl chroot.

config.log attached.
config.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions