Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Build fails: error: use of undeclared identifier 'FP_NAN' #1587

Closed
yurivict opened this issue Dec 22, 2023 · 2 comments
Closed

[Bug]: Build fails: error: use of undeclared identifier 'FP_NAN' #1587

yurivict opened this issue Dec 22, 2023 · 2 comments

Comments

@yurivict
Copy link

Describe the issue

In file included from /usr/ports/devel/abseil/work/abseil-cpp-20230802.1/absl/time/internal/cctz/src/time_zone_format.cc:28:
In file included from /usr/ports/devel/abseil/work/abseil-cpp-20230802.1/absl/time/internal/cctz/include/cctz/time_zone.h:23:
In file included from /usr/include/c++/v1/chrono:746:
In file included from /usr/include/c++/v1/__chrono/convert_to_tm.h:13:
In file included from /usr/include/c++/v1/__chrono/day.h:15:
In file included from /usr/include/c++/v1/compare:145:
In file included from /usr/include/c++/v1/__compare/compare_partial_order_fallback.h:13:
In file included from /usr/include/c++/v1/__compare/partial_order.h:14:
In file included from /usr/include/c++/v1/__compare/weak_order.h:14:
In file included from /usr/include/c++/v1/__compare/strong_order.h:20:
In file included from /usr/include/c++/v1/cmath:317:
/usr/include/c++/v1/math.h:388:31: error: use of undeclared identifier 'FP_NAN'
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
                              ^
/usr/include/c++/v1/math.h:388:39: error: use of undeclared identifier 'FP_INFINITE'
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
                                      ^
/usr/include/c++/v1/math.h:388:52: error: use of undeclared identifier 'FP_NORMAL'
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
                                                   ^
/usr/include/c++/v1/math.h:388:63: error: use of undeclared identifier 'FP_SUBNORMAL'
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
                                                              ^
/usr/include/c++/v1/math.h:388:77: error: use of undeclared identifier 'FP_ZERO'
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
                                                                            ^
/usr/include/c++/v1/math.h:393:21: error: use of undeclared identifier 'FP_ZERO'
  return __x == 0 ? FP_ZERO : FP_NORMAL;
                    ^
/usr/include/c++/v1/math.h:393:31: error: use of undeclared identifier 'FP_NORMAL'
  return __x == 0 ? FP_ZERO : FP_NORMAL;
                              ^

Version: 20230802.1
clang-16
FreeBSD 13.2

Steps to reproduce the problem

regular build

What version of Abseil are you using?

regular build

What operating system and version are you using?

FreeBSD 13.2

What compiler and version are you using?

clang-16

What build system are you using?

cmake

Additional context

Build in the FreeBSD ports' framework.

@yurivict
Copy link
Author

This patch fixes the build:

--- absl/time/internal/cctz/src/time_zone_format.cc.orig        2023-09-18 14:40:01 UTC
+++ absl/time/internal/cctz/src/time_zone_format.cc
@@ -12,7 +12,7 @@
 //   See the License for the specific language governing permissions and
 //   limitations under the License.

-#if !defined(HAS_STRPTIME)
+#if 0 && !defined(HAS_STRPTIME)
 #if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__VXWORKS__)
 #define HAS_STRPTIME 1  // Assume everyone else has strptime().
 #endif
@@ -648,7 +648,7 @@ const char* ParseSubSeconds(const char* dp, detail::fe
 // Parses a string into a std::tm using strptime(3).
 const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) {
   if (dp != nullptr) {
-    dp = strptime(dp, fmt, tm);
+    dp = ::strptime(dp, fmt, tm);
   }
   return dp;
 }

It's unclear why HAS_STRPTIME needs to be defined, and why is strptime ambiguous.

@danfe
Copy link

danfe commented Jan 6, 2024

Duh, this was fixed in commit ded2ec0 but it happened after 20230802.1 release, I believe this issue can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants