casaroli opened a new pull request, #3933: URL: https://github.com/apache/nuttx-apps/pull/3933
## Summary nuttx removed the `EXTERN` macro from its headers (apache/nuttx#21051): a header declares its global data with `extern` inside its `extern "C"` block, as the coding standard says now. In nuttx-apps, 89 headers still define `EXTERN` (`extern "C"` for C++, `extern` for C) and undefine it at their end. The `#undef EXTERN` also removes a definition of `EXTERN` that a program made for its own use, for example Tcl's `tcl.h`. apache/nuttx#21087 makes nxstyle report a definition of `EXTERN` in a header. This PR removes the definitions in nuttx-apps, so that checkpatch passes on these headers when a PR changes them. The commits: 1. Fix the old nxstyle and spelling errors of nine headers that the next commits change (checkpatch checks the whole of each changed file): wrong file paths in three header comments, a comment line without an asterisk, two section names that are not for headers, and six spelling errors. 2. Remove the definitions that nothing uses, in 78 headers: the `#undef EXTERN`, the two `#define EXTERN` lines and the `#else` that held one of them. The `extern "C"` block for C++ stays. 3. The 11 headers that declare global data with `EXTERN` use plain `extern` now. Each of these declarations is inside the `extern "C"` block of its header, so plain `extern` gives it C linkage in C++ too. After this PR, no file of nuttx-apps defines or uses `EXTERN`. ## Impact No change of the code that the compiler sees. Code outside nuttx-apps that declared data with `EXTERN` and relied on a nuttx-apps header to define it no longer compiles; the fix is to write `extern`. The pdcurses headers `curspriv.h`, `pdcnuttx.h` and `include/graphics/curses.h` use names with the `PDC_` prefix of the PDCurses API, which nxstyle reports as mixed case. apache/nuttx#21087 also adds `PDC_` to the prefixes that nxstyle accepts. With it, checkpatch passes on all files of this PR. ## Testing Object files: `qemu-armv8a:netnsh` with 43 more options enabled (the apps pdcurses, fmsynth, the web servers, wapi, ftpc, ftpd, zmodem, the other netutils, nxscope, nxplayer, nxrecorder, bas, ..., and what they need), built once with nuttx-apps master 0c56297b0 and once with this PR, in the same directory. All 626 object files of nuttx-apps are identical (debug information removed). The build compiled about 65 of the 89 changed headers, and 10 of the 11 headers whose declarations change (not `xtables.h`: iptables cannot be enabled in this configuration). Each of the 57 changed headers of `include/` alone, in C and in C++: the same result before and after this PR for each header (46 compile alone in both languages; the other 11 need other headers first, on master too). `tools/checkpatch.sh -c -u -m -g` with the nxstyle of apache/nuttx#21087 passes. The Check job of this PR uses nuttx master, so it reports the `PDC_` names until apache/nuttx#21087 merges. depends-on: apache/nuttx#21087 -- 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]
