-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_Pragma warning weird interaction #69
Comments
@KaeLL , thank you for the report! Could you please attach minimal code reproducer in text (not pictures)? Along with command line you compile it |
create main.c, paste and compile this #include "driver/spi_master.h"
void app_main( void )
{
ESP_ERROR_CHECK( spi_bus_initialize(
VSPI_HOST,
&( const spi_bus_config_t ) {
.miso_io_num = 19,
.mosi_io_num = 23,
.sclk_io_num = 18,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_1,
.intr_flags = ESP_INTR_FLAG_IRAM },
SPI_DMA_CH1 ) );
spi_device_handle_t trf_hdl, w5100_spi_handle;
ESP_ERROR_CHECK( spi_bus_add_device(
VSPI_HOST,
&( const spi_device_interface_config_t ) {
.command_bits = 3,
.address_bits = 5,
.spics_io_num = 26,
.clock_speed_hz = SPI_MASTER_FREQ_20M / 4,
.mode = 1,
.queue_size = 1,
.cs_ena_pretrans = 1,
},
&trf_hdl ) );
ESP_ERROR_CHECK( spi_bus_add_device(
VSPI_HOST,
&( const spi_device_interface_config_t ) {
.clock_speed_hz = 1200000,
.spics_io_num = 17,
.queue_size = 1,
.pre_cb = NULL,
.post_cb = NULL },
&w5100_spi_handle ) );
} It'll get you this [4/9] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/esp_gcc_69.c.obj
/esp_gcc_69/main/esp_gcc_69.c: In function 'app_main':
/esp_gcc_69/main/esp_gcc_69.c:16:27: warning: VSPI_HOST is deprecated in favor of SPI3_HOST
16 | SPI_DMA_CH1 ) );
| ^~~~~~
/esp_gcc_69/main/esp_gcc_69.c:29:27: warning: VSPI_HOST is deprecated in favor of SPI3_HOST
29 | }, &trf_hdl ) );
| ^~~~~~
/esp_gcc_69/main/esp_gcc_69.c:39:27: warning: VSPI_HOST is deprecated in favor of SPI3_HOST
39 | &w5100_spi_handle ) );
| ^~~~~~~~~~~~ |
@KaeLL , can you please simplify your example to only one file that can be compiled outside the IDF environment? I tried to build Do I understand correctly that you reported a bug with an incorrect line indication only? |
@Lapshin i guess you need to pull the latest changes to get espressif/esp-idf@0d7e589 (FWIW to me it looks like incorrect usage of pragmas on IDF side. IDK if we really need those deprecation warnings, seems like it's almost zero cost to keep the old names for compatibility.) |
Be that as it may, still looks like an issue with GCC, no? |
@KaeLL , yes it's an issue that already improved for trunk (gcc's master branch) https://godbolt.org/z/Mr8bsoqa8 But it seems another issue appeared - double warnings output |
@KaeLL , you can track the issue here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117977 |
True, but seems like that is not an ESP-specific issue, upstream GCC also doesn't place the marker correctly: This upstream bug report seems related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102887. Edit: please ignore, next time I will refresh the page before commenting |
Checklist
Issue or Suggestion Description
Compiling one of my apps against the latest IDF:master, the following code
when compiled, produces the following warnings
That looks a bit weird. The lines reported point to the last line of the ESP_ERROR_CHECK macro calls, not the first. The markers are a bit off as well.
Then I checked the macros
I guess C99 _Pragma's don't interact well with the diagnostics part of the front-end? Either way, looks like a bug.
The text was updated successfully, but these errors were encountered: