On Fri, May 16, 2025 at 4:10 AM Kito Cheng <kito.ch...@gmail.com> wrote: > > I am surprised that such generic names are defined within the system > header files, I inclined just rename that to major_version, > minor_version, could you send a patch for that?
major and minor come from extracting the major/minor parts of the device ID; they have been around for a long time. Looks like an include difference exposes them this time around. https://linux.die.net/man/3/minor Thanks, Andrew > > > On Fri, May 16, 2025 at 3:50 PM Songhe Zhu <zhuson...@eswincomputing.com> > wrote: > > > > Hi kito > > When syncing GCC to the master branch and building it on Ubuntu 18.04, > > I encounter the following warnings and errors: > > > > These issues arise because the values major and minor conflict with the > > macros major/minor defined in <sys/sysmacros.h>. To avoid compatibility > > problems when using a newer version of GCC on older Ubuntu environment, we > > propose three solutions: > > 1. Undefine the macros temporarily:: > > > > #pragma push_macro("major") > > #undef major > > #pragma push_macro("minor") > > #undef minor > > /* ... function code ... */ > > #pragma pop_macro("major") > > #pragma pop_macro("minor") > > > > 2. Rename major/minor to non-conflicting names ? > > > > 3. Build in a newer Ubuntu environment (e.g., Ubuntu 22.04) to bypass > > legacy macro conflicts. > > --We will try it. > > > > refernece patch: RISC-V: Generate extension table in documentation from > > riscv-ext.def · gcc-mirror/gcc@124cbbb > > > > Thanks a lot~ > > > > ________________________________ > > zhuson...@eswincomputing.com