Skip to content
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

Build warnings -- [-Wignored-qualifiers] #252

Open
henrygab opened this issue Aug 14, 2020 · 0 comments
Open

Build warnings -- [-Wignored-qualifiers] #252

henrygab opened this issue Aug 14, 2020 · 0 comments

Comments

@henrygab
Copy link

henrygab commented Aug 14, 2020

original log example

click to expand

/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp: In function 'void banzai()':
/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp:32:55: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
   32 | #define APP_START ((volatile uint32_t)(&__text_start__) + 4)
      |                                                       ^
/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp:77:6: note: in expansion of macro 'APP_START'
   77 |  if (APP_START < (0x200 + 4)) {
      |      ^~~~~~~~~

/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp:32:55: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
   32 | #define APP_START ((volatile uint32_t)(&__text_start__) + 4)
      |                                                       ^
/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp:87:46: note: in expansion of macro 'APP_START'
   87 |  NVMCTRL->ADDR.reg  = (uintptr_t)&NVM_MEMORY[APP_START / 4];
      |                                              ^~~~~~~~~

/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp: In function 'void banzai()':
/home/runner/.arduino15/packages/adafruit/hardware/samd/1.6.0/cores/arduino/Reset.cpp:32:55: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
   32 | #define APP_START ((volatile uint32_t)(&__text_start__) + 4)
      |                                                       ^

See https://github.com/adafruit/ArduinoCore-samd/runs/965558867.

Simplified log

.../samd/1.6.0/cores/arduino/Reset.cpp: In function 'void banzai()':

.../samd/1.6.0/cores/arduino/Reset.cpp:32:55: 
    warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
   32 | #define APP_START ((volatile uint32_t)(&__text_start__) + 4)
      |                                                       ^
.../samd/1.6.0/cores/arduino/Reset.cpp:77:6:
    note: in expansion of macro 'APP_START'
   77 |  if (APP_START < (0x200 + 4)) {
      |      ^~~~~~~~~

.../samd/1.6.0/cores/arduino/Reset.cpp:32:55:
    warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
   32 | #define APP_START ((volatile uint32_t)(&__text_start__) + 4)
      |                                                       ^
..../samd/1.6.0/cores/arduino/Reset.cpp:87:46:
    note: in expansion of macro 'APP_START'
   87 |  NVMCTRL->ADDR.reg  = (uintptr_t)&NVM_MEMORY[APP_START / 4];
      |                                              ^~~~~~~~~

-Wignored-qualifiers information

Best explanation may be in another github comment.

Interpretation

Basically, casting to a volatile uint32_t doesn't make sense, as it's treated as a standard uint32_t?

Recommendation

tbd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant