Message ID | CABmJbFULny-EO+tqdHOxZznFnT6enqxMeX-ixSvueKryzuhhHg@mail.gmail.com |
---|---|
State | Rejected |
Headers | show |
On 03/12/2014 05:49 PM, Alexander Chemeris wrote: >>> +#include <osmocom/core/logging.h> >>> + >>> +struct log_info fake_log_info = {}; >>> + >>> struct test_case { >>> const uint8_t *input; >>> const uint16_t input_length; >>> @@ -278,6 +282,9 @@ int main(int argc, char** argv) >>> int nchars; >>> char result[256]; >>> >>> + /* Fake logging. */ >>> + osmo_init_logging(&fake_log_info); >> >> osmo_init_logging() is declared in include/osmocom/core/application.h > > Fixed, thanks. > > I don't like this fact that in C it's possible to use a non-defined > function and it's just a warning. gcc and clang can error on it with the flag -Werror=implicit-function-declaration
12 марта 2014 г. 22:18 пользователь <noselasd@fiane.dyndns.org> написал: > > On 03/12/2014 05:49 PM, Alexander Chemeris wrote: > >>>> +#include <osmocom/core/logging.h> >>>> + >>>> +struct log_info fake_log_info = {}; >>>> + >>>> struct test_case { >>>> const uint8_t *input; >>>> const uint16_t input_length; >>>> @@ -278,6 +282,9 @@ int main(int argc, char** argv) >>>> int nchars; >>>> char result[256]; >>>> >>>> + /* Fake logging. */ >>>> + osmo_init_logging(&fake_log_info); >>> >>> >>> osmo_init_logging() is declared in include/osmocom/core/application.h >> >> >> Fixed, thanks. >> >> I don't like this fact that in C it's possible to use a non-defined >> function and it's just a warning. > > > gcc and clang can error on it with the flag > -Werror=implicit-function-declaration Should we add this to our default Makefiles? Any opinions? Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO/Founder Fairwaves LLC https://fairwaves.co
On Wed, Mar 12, 2014 at 08:49:52PM +0400, Alexander Chemeris wrote: > +#include <osmocom/core/logging.h> > +#include <include/osmocom/core/application.h> include/osmocom/core??
From 190feef753fd271f3668d0a55cd5edd0215021bf Mon Sep 17 00:00:00 2001 From: Alexander Chemeris <Alexander.Chemeris@gmail.com> Date: Fri, 7 Mar 2014 20:42:03 +0100 Subject: [PATCH 2/6] sms_test: Do not crash on logging. --- tests/sms/sms_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 755b321..30ce1f4 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -31,6 +31,11 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/utils.h> +#include <osmocom/core/logging.h> +#include <include/osmocom/core/application.h> + +struct log_info fake_log_info = {}; + struct test_case { const uint8_t *input; const uint16_t input_length; @@ -278,6 +283,9 @@ int main(int argc, char** argv) int nchars; char result[256]; + /* Fake logging. */ + osmo_init_logging(&fake_log_info); + /* test 7-bit encoding */ for (i = 0; i < ARRAY_SIZE(test_encode); ++i) { /* Test legacy function (return value only) */ -- 1.7.9.5