#66042 closed defect (fixed)

icu-devel 72.1 fails to build on 10.6.8: error: expected ':' before 'PRId64'

Reported by: barracuda156 Owned by: catap (Kirill A. Korinsky)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc:
Port: icu-devel

Description

writesrc.cpp: In function 'void usrc_writeArray(FILE*, const char*, const void*, int32_t, int32_t, const char*, const char*)':
writesrc.cpp:202:34: error: expected ':' before 'PRId64'
  202 |         fprintf(f, value<=9 ? "%" PRId64 : "0x%" PRIx64, value);
      |                                  ^~~~~~~
      |                                  :
writesrc.cpp:35:1: note: 'PRId64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   34 | #include "util.h"
  +++ |+#include <cinttypes>
   35 | 
writesrc.cpp:202:35: error: 'PRId64' was not declared in this scope
  202 |         fprintf(f, value<=9 ? "%" PRId64 : "0x%" PRIx64, value);
      |                                   ^~~~~~
writesrc.cpp:202:35: note: 'PRId64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?

Identical failure on 10.6 PPC too.

Attachments (1)

main.log (495.0 KB) - added by barracuda156 18 months ago.

Download all attachments as: .zip

Change History (4)

Changed 18 months ago by barracuda156

Attachment: main.log added

comment:1 Changed 18 months ago by kencu (Ken)

usual fix is to add this to cppflags or cxxflags:

-D__STDC_FORMAT_MACROS

comment:2 in reply to:  1 Changed 18 months ago by barracuda156

Replying to kencu:

usual fix is to add this to cppflags or cxxflags:

-D__STDC_FORMAT_MACROS

Thank you! I found that, but apparently a proper fix will be change the header to <cinttypes>: https://en.cppreference.com/w/cpp/header/cinttypes (changing header fixes the problem).

comment:3 Changed 17 months ago by catap (Kirill A. Korinsky)

Resolution: fixed
Status: assignedclosed

In d2b8967c6c34624863b8c7fd5a62dcfcc2a209b9/macports-ports (master):

icu-devel: fix build on 10.6

Closes: #66042

[skip ci]

Note: See TracTickets for help on using tickets.