casaroli opened a new pull request, #21087: URL: https://github.com/apache/nuttx/pull/21087
## Summary The coding standard says that a header does not define a macro such as `EXTERN`. A header declares global data with `extern` inside its `extern "C"` block (#21051). The `#undef EXTERN` at the end of such a header removes a definition that a program made for its own use, for example Tcl's `tcl.h`. Three PRs that merged while #21051 was open added `EXTERN` again in eight headers. With this change, nxstyle reports `#define EXTERN` and `#undef EXTERN` in a header (also with spaces after `#`), so that checkpatch finds a new one. Names such as `EXTERNAL` or `EXTERN_C` are not reported. C files are not checked. ## Impact Only nxstyle changes. Files that still define `EXTERN`, and that a PR touches, now fail checkpatch: - nuttx: the eight headers added by #20796 (`include/nuttx/poll.h`), #20963 (`drivers/vhost/vhost-serial.h`) and #19250 (six headers of `raspberrypi-pico-2-w`). A follow-up PR removes the definitions there. - nuttx-apps: 89 headers that define their own `EXTERN`. A nuttx-apps PR removes them. ## Testing All C files and headers of nuttx (master 5055d980da3) and nuttx-apps (master 0c56297b0), 20785 files, checked with nxstyle before and after this change. The output is different only for the 8 nuttx headers and the 89 nuttx-apps headers listed above, and only by the new error. No other message changed. Test headers: `#define EXTERN`, `# define EXTERN` and `#undef EXTERN` are reported; `#define EXTERNAL`, `#define EXTERN_C` and `#undef EXTERNAL` are not. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
