diff mbox series

[1/1] package/dvb-apps: fix build with gcc >= 14

Message ID 20240723162533.549929-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/dvb-apps: fix build with gcc >= 14 | expand

Commit Message

Fabrice Fontaine July 23, 2024, 4:25 p.m. UTC
Workaround for glibc 2.31 added by commit
bbe170dbcf4ddb63e76299214e2c18b16e5cf016 back in 2020 is incorrect as it
writes new_time (a pointer on time_t) into timespec.tv_sec (i.e. time_t).
This mistake raises the following build failure with gcc >= 14:

dvbdate.c: In function 'set_time':
dvbdate.c:313:18: error: assignment to '__time_t' {aka 'long int'} from 'time_t *' {aka 'long int *'} makes integer from pointer without a cast [-Wint-conversion]
  313 |         s.tv_sec = new_time;
      |                  ^

It shall be noted that gentoo also spotted this mistake:
https://gitweb.gentoo.org/repo/gentoo.git/commit/media-tv/linuxtv-dvb-apps/files?id=81e99f1c753d1cb564be29b22dcd8927830c4b9a

Fixes: bbe170dbcf4ddb63e76299214e2c18b16e5cf016
 - http://autobuild.buildroot.org/results/e99b9ebf602d307fbc32f2a367e95177f53a68f9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/dvb-apps/0006-fix-glibc-2.31.patch | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni July 23, 2024, 9:03 p.m. UTC | #1
On Tue, 23 Jul 2024 18:25:33 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Workaround for glibc 2.31 added by commit
> bbe170dbcf4ddb63e76299214e2c18b16e5cf016 back in 2020 is incorrect as it
> writes new_time (a pointer on time_t) into timespec.tv_sec (i.e. time_t).
> This mistake raises the following build failure with gcc >= 14:
> 
> dvbdate.c: In function 'set_time':
> dvbdate.c:313:18: error: assignment to '__time_t' {aka 'long int'} from 'time_t *' {aka 'long int *'} makes integer from pointer without a cast [-Wint-conversion]
>   313 |         s.tv_sec = new_time;
>       |                  ^
> 
> It shall be noted that gentoo also spotted this mistake:
> https://gitweb.gentoo.org/repo/gentoo.git/commit/media-tv/linuxtv-dvb-apps/files?id=81e99f1c753d1cb564be29b22dcd8927830c4b9a
> 
> Fixes: bbe170dbcf4ddb63e76299214e2c18b16e5cf016
>  - http://autobuild.buildroot.org/results/e99b9ebf602d307fbc32f2a367e95177f53a68f9
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/dvb-apps/0006-fix-glibc-2.31.patch | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to master, thanks. However, I'm wondering if we shouldn't also
remove this package. It is considered legacy
by https://www.linuxtv.org/projects.php. Its repository at
https://linuxtv.org/legacy-hg/dvb-apps is broken (no CSS) and has
seen no commit since 2014. So I believe we could drop it.

Best regards,

Thomas
Peter Korsgaard Aug. 31, 2024, 4:58 p.m. UTC | #2
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Workaround for glibc 2.31 added by commit
 > bbe170dbcf4ddb63e76299214e2c18b16e5cf016 back in 2020 is incorrect as it
 > writes new_time (a pointer on time_t) into timespec.tv_sec (i.e. time_t).
 > This mistake raises the following build failure with gcc >= 14:

 > dvbdate.c: In function 'set_time':
 > dvbdate.c:313:18: error: assignment to '__time_t' {aka 'long int'} from 'time_t *' {aka 'long int *'} makes integer from pointer without a cast [-Wint-conversion]
 >   313 |         s.tv_sec = new_time;
 >       |                  ^

 > It shall be noted that gentoo also spotted this mistake:
 > https://gitweb.gentoo.org/repo/gentoo.git/commit/media-tv/linuxtv-dvb-apps/files?id=81e99f1c753d1cb564be29b22dcd8927830c4b9a

 > Fixes: bbe170dbcf4ddb63e76299214e2c18b16e5cf016
 >  - http://autobuild.buildroot.org/results/e99b9ebf602d307fbc32f2a367e95177f53a68f9

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2024.05.x, thanks.
diff mbox series

Patch

diff --git a/package/dvb-apps/0006-fix-glibc-2.31.patch b/package/dvb-apps/0006-fix-glibc-2.31.patch
index 079a24f149..51c03d3e2e 100644
--- a/package/dvb-apps/0006-fix-glibc-2.31.patch
+++ b/package/dvb-apps/0006-fix-glibc-2.31.patch
@@ -4,6 +4,8 @@  as stime func doesn't exists anymore in newer versions of glibc >= 2.31 due
 to obseletion, a replacment with clock_settime is inorder to fix the issue.
 
 Signed-off-by: Dagg Stompler <daggs@gmx.com>
+[Fabrice: fix for gcc >= 14]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 
 --- a/util/dvbdate/dvbdate.c
 +++ b/util/dvbdate/dvbdate.c
@@ -13,7 +15,7 @@  Signed-off-by: Dagg Stompler <daggs@gmx.com>
  {
 -	if (stime(new_time)) {
 +	struct timespec s = {0};
-+	s.tv_sec = new_time;
++	s.tv_sec = *new_time;
 +
 +	if (clock_settime(CLOCK_REALTIME, &s)) {
  		perror("Unable to set time");