dfandrich / gpscorrelate

C program to match GPS tracks to photographs, and store the matches in the EXIF data in the photographs.
https://dfandrich.github.io/gpscorrelate/
GNU General Public License v2.0
24 stars 8 forks source link

Fix gpx-read.c: implicit declaration of function malloc #25

Closed listout closed 5 months ago

listout commented 5 months ago

First observed in Gentoo Linux when using GCC 14. Most probably due to GCC 14 enabling -Wimplicit-function-declaration. Thus resulting in errors such as:

gpx-read.c: In function ExtractTrackPoints:
gpx-read.c:122:70: error: implicit declaration of function malloc [-Wimplicit-function-declaration]
  122 |                        LastPoint->Next = (struct GPSPoint*) malloc(sizeof(struct GPSPoint));

Bug: https://bugs.gentoo.org/923125

dfandrich commented 5 months ago

I don't think this is relevant any longer in the version in master after a small refactoring. Could you verify that?

listout commented 5 months ago

I don't think this is relevant any longer in the version in master after a small refactoring. Could you verify that?

Yes, I think so. I don't see call to malloc at all in gpx-read.c (in main)

dfandrich commented 5 months ago

I found (and fixed) this problem in gpx-read.c just now, so I think the code is now fine.