Eclipse generating 'Invalid Args' for ESP_LOG() macros

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Eclipse generating 'Invalid Args' for ESP_LOG() macros

Postby william.ferguson.au » Tue Feb 05, 2019 12:27 am

The code compiles OK, but the Eclipse edit window has every ESP_LOGI() statement underlined in red, saying that it has invalid arguments.

Eg
static const char* TAG = "wt_comms";

ESP_LOGI(TAG, "Reconnecting to WiFi");


Image

When you hover over it, the popup gives:
"Invalid arguments '
Candidates are:
void esp_log_write(enum {/wt_starter_esp_idf/components/arduino-esp32/tools/sdk/include/log/esp_log.h:822}, const char *, const char *, ...)
'"


All my includes appear to be OK. Everything else gets reported correctly.
It's just the ESP_LOG macros.

What am I missing?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros

Postby ESP_Angus » Tue Feb 05, 2019 2:25 am

If you use F3 to "go to" the source file represented by the "#include esp_log.h" line, does it go to the correct source file? Are that header file's recursive includes properly referenced?

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros

Postby william.ferguson.au » Tue Feb 05, 2019 5:00 am

Yes, it goes to esp-idf/components/log/include/esp_log.h
Are that header file's recursive includes properly referenced?
I think so. When I look at the includes they are not marked as being incorrect.

esp_log.h is found twice in my include path.
Once in esp-idf and once in arduino-esp32.
Is that likely the problem?

William

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros

Postby ESP_igrr » Tue Feb 05, 2019 10:46 pm

Once in esp-idf and once in arduino-esp32.
Is that likely the problem?
It might be because esp_log_level_t is an anonymous enum, and Eclipse builds an identifier for it out of file path:

enum {/wt_starter_esp_idf/components/arduino-esp32/tools/sdk/include/log/esp_log.h:822}

Hypothetically, changing enum declaration from

typedef enum { } esp_log_level_t;

to

typedef enum esp_log_level_t { } esp_log_level_t;

in both header files should fix the issue.

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros

Postby william.ferguson.au » Tue Feb 05, 2019 11:17 pm

Thank you !!! That worked.

It now let's me see the other warnings that Eclipse has brought up.
All of them because of duplicate includes from components/arduino-esp32/tools/sdk/include

What is the standard way of ensuring that components/arduino-esp32/tools/sdk/include isn't picked up?

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Re: Eclipse generating 'Invalid Args' for ESP_LOG() macros

Postby william.ferguson.au » Tue Feb 05, 2019 11:47 pm

I have also raised this as an issue at arduino-esp32 https://github.com/espressif/arduino-esp32/issues/2426
As I suspect it needs to be fixed in the arduino-esp32/component.mk

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Sang_Huynh and 208 guests