fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
19.83k stars 2.42k forks source link

[build error] error: expected '>' #4035

Closed zejun-chen closed 1 week ago

zejun-chen commented 1 week ago

Hi,

We have a build error when linking fmt as the third party, while it is weird. Here it the error message:

torch/include/fmt/format.h:3250:14: error: expected '>'
 3250 |   if (f.e < 0) {
      |              ^
torch/include/fmt/format.h:3250:11: note: to match this '<'
 3250 |   if (f.e < 0) {
      |           ^
torch/include/fmt/format.h:3250:14: error: expected unqualified-id
 3250 |   if (f.e < 0) {
      |              ^

The correlated code: https://github.com/fmtlib/fmt/blob/e69e5f977d458f2650bb346dadf2ad30c5320281/include/fmt/format.h#L3250

Does anyone have the same issue?

Thank you.

vitaut commented 1 week ago

The code looks correct. My guess is that the problem is in some macro conflict, I recommend looking at preprocessed code.

zejun-chen commented 1 week ago

The code looks correct. My guess is that the problem is in some macro conflict, I recommend looking at preprocessed code.

OK. Thank you for help.