wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.04k stars 606 forks source link

[wpilibc] Add FRC_ReportWarning #6681

Open spacey-sooty opened 1 month ago

spacey-sooty commented 1 month ago

See https://github.com/wpilibsuite/allwpilib/issues/6680#issuecomment-2142182644

KangarooKoala commented 1 month ago

2 things: 1) Do we want a warning version of FRC_MakeError? 2) Do we want FRC_ReportWarning to be defined in terms of FRC_ReportError? (See below)

  #define FRC_ReportWarning(format, ...) \
    FRC_ReportError(::frc::warn::Warning __VA_OPT__(, ) __VA_ARGS__)

We'd have to double check that the __LINE__ and __FILE__ macros get processed properly. Based on my reading of https://en.cppreference.com/w/cpp/preprocessor/replace, they should be, but it would be good to make sure.