Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ernsteiswuerfel opened this issue Mar 6, 2024 · 0 comments

Comments

@ernsteiswuerfel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant