https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102484
Bug ID: 102484 Summary: Refactor duplicated cb_cpp_diagnostic_cpp_option Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: manu at gcc dot gnu.org Target Milestone: --- This function: https://github.com/gcc-mirror/gcc/blob/8bafc9640f353ff11c0535a03096fb4db9a5bb95/gcc/fortran/cpp.c#L1062 is a duplicate of: https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/c-family/c-common.c#L6293 The function should be common to the whole compiler and it could be generated static inline by: https://github.com/gcc-mirror/gcc/blob/8bafc9640f353ff11c0535a03096fb4db9a5bb95/gcc/opth-gen.awk#L556 so that it is available by including options.h. Or even better, generate only a declaration above, generate the body from optc-gen.awk and move cpp_reason_option_codes inside the function rather than being yet another global. Note that this will also remove the need to include cpplib.h in options.h, which is a nice cleanup.