This piece of code used to be compiled with no errors few months ago. I lost the VM image so I setup a new linux VM with latest GCC and libraries. But now I get these errors and warnings.
In file included from /opt/Espressif/ESP8266_SDK/include/ets_sys.h:12:0,
from include/espmissingincludes.h:4,
from driver/i2c.c:20:
driver/i2c.c: In function 'i2c_init':
/opt/Espressif/ESP8266_SDK/include/eagle_soc.h:247:94: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
#define PIN_FUNC_SELECT(PIN_NAME, FUNC) do {WRITE_PERI_REG(PIN_NAME,READ_PERI_REG(PIN_NAME) & (~(PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S)) |( (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S) );} while (0)
^
/opt/Espressif/ESP8266_SDK/include/eagle_soc.h:50:87: note: in definition of macro 'WRITE_PERI_REG'
#define WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) =(val)
^
driver/i2c.c:64:5: note: in expansion of macro 'PIN_FUNC_SELECT'
PIN_FUNC_SELECT(I2C_SDA_MUX, I2C_SDA_FUNC);
^
/opt/Espressif/ESP8266_SDK/include/eagle_soc.h:247:94: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
#define PIN_FUNC_SELECT(PIN_NAME, FUNC) do {WRITE_PERI_REG(PIN_NAME,READ_PERI_REG(PIN_NAME) & (~(PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S)) |( (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S) );} while (0)
^
/opt/Espressif/ESP8266_SDK/include/eagle_soc.h:50:87: note: in definition of macro 'WRITE_PERI_REG'
#define WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) =(val)
^
driver/i2c.c:65:5: note: in expansion of macro 'PIN_FUNC_SELECT'
PIN_FUNC_SELECT(I2C_SCK_MUX, I2C_SCK_FUNC);
^
cc1: all warnings being treated as errors
make: *** [build/driver/i2c.o] Error 1
Does anyone know how to solve these?