Skip to content

GCC failes compilation at ws_bootstrap_ffn.c #15532

@sykacek

Description

@sykacek

Description of defect

When compiling with arm-none-eabi-gcc, compilation terminates due to a mistake in syntax in the source code. Apparently, source code is alright, it is related with expansion of macros, so do I have some wrong definitions?

[ERROR] In file included from /home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/ns_trace.h:35,
                 from /home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:22:
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c: In function 'ws_bootstrap_ffn_dhcp_info_notify_cb':
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:278:98: error: expected ')' before 'PRIu64'
  278 |                         tr_info("Network Time configuration %s status:%" PRIu16 " time stamp: %" PRIu64 " deviation: %"PRId16" Time Zone: %"PRId16, ret == 0 ? "notified" : "notify FAILED", time_configuration.status, time_configuration.timestamp, time_configuration.deviation, time_configuration.timezone);
      |                                                                                                  ^~~~~~
/home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/mbed_trace.h:129:79: note: in definition of macro 'tr_info'
  129 | #define tr_info(...)            mbed_tracef(TRACE_LEVEL_INFO,    TRACE_GROUP, __VA_ARGS__)   //!< Print info message
      |                                                                               ^~~~~~~~~~~
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:278:33: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
  278 |                         tr_info("Network Time configuration %s status:%" PRIu16 " time stamp: %" PRIu64 " deviation: %"PRId16" Time Zone: %"PRId16, ret == 0 ? "notified" : "notify FAILED", time_configuration.status, time_configuration.timestamp, time_configuration.deviation, time_configuration.timezone);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/mbed_trace.h:129:79: note: in definition of macro 'tr_info'
  129 | #define tr_info(...)            mbed_tracef(TRACE_LEVEL_INFO,    TRACE_GROUP, __VA_ARGS__)   //!< Print info message
      |                                                                               ^~~~~~~~~~~
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:278:62: note: format string is defined here
  278 |                         tr_info("Network Time configuration %s status:%" PRIu16 " time stamp: %" PRIu64 " deviation: %"PRId16" Time Zone: %"PRId16, ret == 0 ? "notified" : "notify FAILED", time_configuration.status, time_configuration.timestamp, time_configuration.deviation, time_configuration.timezone);
      |                                                             ~^
      |                                                              |
      |                                                              char *
In file included from /home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/ns_trace.h:35,
                 from /home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:22:
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:278:33: warning: format '%hu' expects a matching 'int' argument [-Wformat=]
  278 |                         tr_info("Network Time configuration %s status:%" PRIu16 " time stamp: %" PRIu64 " deviation: %"PRId16" Time Zone: %"PRId16, ret == 0 ? "notified" : "notify FAILED", time_configuration.status, time_configuration.timestamp, time_configuration.deviation, time_configuration.timezone);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/mbed_trace.h:129:79: note: in definition of macro 'tr_info'
  129 | #define tr_info(...)            mbed_tracef(TRACE_LEVEL_INFO,    TRACE_GROUP, __VA_ARGS__)   //!< Print info message
      |                                                                               ^~~~~~~~~~~
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:278:33: warning: spurious trailing '%' in format [-Wformat=]
  278 |                         tr_info("Network Time configuration %s status:%" PRIu16 " time stamp: %" PRIu64 " deviation: %"PRId16" Time Zone: %"PRId16, ret == 0 ? "notified" : "notify FAILED", time_configuration.status, time_configuration.timestamp, time_configuration.deviation, time_configuration.timezone);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/mbed_trace.h:129:79: note: in definition of macro 'tr_info'
  129 | #define tr_info(...)            mbed_tracef(TRACE_LEVEL_INFO,    TRACE_GROUP, __VA_ARGS__)   //!< Print info message
      |                                                                               ^~~~~~~~~~~
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:277:29: warning: unused variable 'ret' [-Wunused-variable]
  277 |                         int ret = ns_time_system_timezone_info_notify(&time_configuration);
      |                             ^~~
In file included from /home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/ns_trace.h:35,
                 from /home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:22:
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:311:102: error: expected ')' before 'PRIu64'
  311 |                                 tr_info("Network Time %s: Era:%"PRId32" Offset:%"PRIu32" old time: %"PRIu64 " time: %"PRIu64, ret == 0 ? "updated" : "update FAILED", era, offset, current_time, network_time);
      |                                                                                                      ^~~~~~
/home/mike/mbed-os/platform/mbed-trace/include/mbed-trace/mbed_trace.h:129:79: note: in definition of macro 'tr_info'
  129 | #define tr_info(...)            mbed_tracef(TRACE_LEVEL_INFO,    TRACE_GROUP, __VA_ARGS__)   //!< Print info message
      |                                                                               ^~~~~~~~~~~
/home/mike/mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap_ffn.c:311:4

There are some warnings as well.

Target(s) affected by this defect ?

I am trying to compile for nucleo f767zi board.

Toolchain(s) (name and version) displaying this defect ?

arm-none-eabi-gcc

arm-none-eabi-gcc (15:10.3-2021.07-4) 10.3.1 20210621 (release)

mbed-cli

1.10.5

python

Python 3.10.12

pip

pip 24.3.1

What version of Mbed-os are you using (tag or sha) ?

mbed os

#define MBED_MAJOR_VERSION 6
#define MBED_MINOR_VERSION 17
#define MBED_PATCH_VERSION 0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

uname -a

Linux  6.5.0-44-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC  x86_64 x86_64 x86_64 GNU/Linux

How is this defect reproduced ?

I am using mbed os externally outside the project, structure is

~/
├── mbed-os
└── mbed-os-example

mbed-os in ~ directory is a symbolic link, mbed-os path is specified with mbed-cli
mbed-cli config --list

[mbed] Global config:
GCC_ARM_PATH=/usr/bin/
MBED_OS_DIR=/home/mike/mbed-os
TARGET=nucleo_f767zi
ARM6_PATH=/opt/arm6/bin
TOOLCHAIN=GCC_ARM

I tried buildind the project in mbed-os-example with

mbed compile --source /home/mike/mbed-os

I am absolutely new in Mbed-OS, after I figured out how to connect the mbed tools together I can't get over the errors. Is there a way how to fix it before editing the source code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions