[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] bug in timehint.c:261 ntpshm_put

From: Robert Norris
Subject: Re: [gpsd-dev] bug in timehint.c:261 ntpshm_put
Date: Mon, 28 Nov 2016 22:31:17 +0000

I don't see why the compiler is complaining.

What is your system and compiler version?

The full statement is:

   gpsd_log(&session->context->errout, LOG_PROG,
         "NTP: ntpshm_put(%s %s) %s @ %s\n",
         (precision == -20) ? "pps" : "clock",
         real_str, clock_str);

So argument five is on line 264:

(precision == -20) ? "pps" : "clock"

which is boolean statement returning a string dependant on the value of the variable precision.

Can you describe what conditions and how you are running gpsd to make it crash?

Perhaps you can make line 264 simply "a time source", to temporarily appease the compiler and see if gpsd still crashes here.

Also if possible running gpsd under a debugger and getting the backtrace would also be useful information.

Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.

From: gpsd-dev <gpsd-dev-bounces+address@hidden> on behalf of Max Schulze <address@hidden>
Sent: 21 November 2016 15:30:14
To: address@hidden
Subject: [gpsd-dev] bug in timehint.c:261 ntpshm_put

I compiled ba9957de and run it in debug mode and it crashes at said line.

Compiler hint is

timehint.c:261:7: warning: format '%s' expects argument of type 'char
*', but argument 5 has type 'int' [-Wformat=]
       "NTP: ntpshm_put(%s,%s) %s @ %s\n",

I am not comfortable in C but should'nt it be "...ntpshm_put(%s,%d)" as
precision is an int?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]