Skip to content
Snippets Groups Projects
Commit fdb8a92c authored by mio's avatar mio Committed by Celeste
Browse files

community/calcurse: fix build with gcc 14 on 32-bit arches

Fix -Wincompatible-pointer-types error with gcc 14 on 32-bit arches.

```
day.c: In function 'day_paste_item':
day.c:870:25: error: passing argument 3 of 'overflow_add' from incompatible pointer type [-Wincompatible-pointer-types]
  870 |                         &until)
      |                         ^~~~~~
      |                         |
      |                         time_t * {aka long long int *}
In file included from day.c:43:
calcurse.h:1275:31: note: expected 'long int *' but argument is of type 'time_t *' {aka 'long long int *'}
 1275 | long overflow_add(long, long, long *);
      |                               ^~~~~~
```
parent f9e16776
No related branches found
No related tags found
1 merge request!75498community/calcurse: fix build with gcc 14 on 32-bit arches
Pipeline #274064 skipped
Use time_t in overflow_add() time value.
--- calcurse-4.8.1-orig/src/calcurse.h
+++ calcurse-4.8.1/src/calcurse.h
@@ -1272,7 +1272,7 @@
int starts_with(const char *, const char *);
int starts_with_ci(const char *, const char *);
int hash_matches(const char *, const char *);
-long overflow_add(long, long, long *);
+long overflow_add(long, long, time_t *);
long overflow_mul(long, long, long *);
time_t next_wday(time_t, int);
int wday_per_year(int, int);
--- calcurse-4.8.1-orig/src/utils.c
+++ calcurse-4.8.1/src/utils.c
@@ -1260,8 +1260,8 @@
dur += in;
if (start) {
/* wanted: end = start + dur * MININSEC */
- time_t end;
- long p, s;
+ time_t end, s;
+ long p;
if (overflow_mul(dur, MININSEC, &p))
return 0;
if (overflow_add(start, p, &s))
@@ -2043,7 +2043,7 @@
/*
* Overflow check for addition with positive second term.
*/
-long overflow_add(long x, long y, long *z)
+long overflow_add(long x, long y, time_t *z)
{
if (!YEAR1902_2037)
goto exit;
......@@ -3,7 +3,7 @@
# Maintainer: Roberto Oliveira <robertoguimaraes8@gmail.com>
pkgname=calcurse
pkgver=4.8.1
pkgrel=0
pkgrel=1
pkgdesc="A text-based personal organizer"
url="https://calcurse.org/"
license="BSD-2-Clause"
......@@ -15,6 +15,7 @@ source="
https://calcurse.org/files/calcurse-$pkgver.tar.gz
0001-Fix-segfault-when-importing-iCal-files.patch
0002-gcc14-32-bit.patch
"
build() {
......@@ -52,4 +53,5 @@ caldav() {
sha512sums="
a0a0bcfceb28a4e363168711a3c2de8f6e94d7f12aa78ff40f157c247ea6a41646bd218a1defba2d128b131ed0ab71c4d417820a0af0adbaa215011b11f0a040 calcurse-4.8.1.tar.gz
91d7cdfa8c890eb5782171a46e70896a81893ca477499fdbe9f6683af376043ee7fe3172ad90f5db1e08c43a11441504ad552083ea8d42dc9d88267a483e7e58 0001-Fix-segfault-when-importing-iCal-files.patch
6b221f883e3b1de9c6f0ce74d5b3b6fec064636eed0b48c8e141bfe1b48b635a8a29089ed053f51040e3d39428837f791e15ef403d1820c8c1ec3193b2f997e8 0002-gcc14-32-bit.patch
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment