[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH] Fix a compiler warning when compiling with clang.
From: |
Beat Bolli |
Subject: |
[gpsd-dev] [PATCH] Fix a compiler warning when compiling with clang. |
Date: |
Thu, 3 May 2012 23:14:03 +0200 |
I tried to compile GPSd with clang from the LLVM project.
This was the command line: CC=clang scons nmea2000=false
I had to exclude the NMEA2000 driver because <time.h> on Ubuntu 12.04
(Precise Pangolin) doesn't define clock_gettime().
This was the only warning:
clang -o gpxlogger.o -c -O2 gpxlogger.c
gpxlogger.c:338:5: warning: expression result unused [-Wunused-value]
(int)gps_mainloop(&gpsdata, 5000000, conditionally_log_fix);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Everything else compiled fine. "CC=clang scons check" passes.
---
gpxlogger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gpxlogger.c b/gpxlogger.c
index 6f4ae4c..eff63ef 100644
--- a/gpxlogger.c
+++ b/gpxlogger.c
@@ -335,7 +335,7 @@ int main(int argc, char **argv)
(void)gps_stream(&gpsdata, flags, source.device);
print_gpx_header();
- (int)gps_mainloop(&gpsdata, 5000000, conditionally_log_fix);
+ (void)gps_mainloop(&gpsdata, 5000000, conditionally_log_fix);
print_gpx_footer();
(void)gps_close(&gpsdata);
--
1.7.10
- [gpsd-dev] [PATCH] Fix a compiler warning when compiling with clang.,
Beat Bolli <=