Opened 3 years ago
Last modified 3 years ago
#65161 assigned defect
nano @6.3: error: 'const struct stat' has no member named 'st_atimespec'
Reported by: | SerpentChris (Chris Calderon) | Owned by: | grimreaper (Eitan Adler) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.2 |
Keywords: | tiger | Cc: | jmroot (Joshua Root) |
Port: | nano |
Description
I'm trying to build nano on my PowerMac G5 running Tiger 10.4.11. That last version from a couple months ago built fine but the latest version does not build. It fails with a complaint about trying to access non-existing members of struct stat
in file fstatat.c. I've attached my log.
Attachments (1)
Change History (2)
Changed 3 years ago by SerpentChris (Chris Calderon)
Attachment: | nano_main.log added |
---|
comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | jmroot added; grimreaper@… removed |
---|---|
Keywords: | tiger added |
Owner: | set to grimreaper |
Status: | new → assigned |
Summary: | nano @6.3 : Build failure on Mac OS X Tiger → nano @6.3: error: 'const struct stat' has no member named 'st_atimespec' |
Note: See
TracTickets for help on using
tickets.
Yes, I can confirm that on Tiger on Intel.
st_atimespec
,st_ctimespec
,st_mtimespec
are the normal names for thosestat
members on macOS, and nano's configure script detects that. (GNU operating systems use different names for them.)Looking in /usr/include/sys/stat.h, the
stat
struct will have those members unless_POSIX_C_SOURCE
is defined.I don't see anything in the nano build that sets
_POSIX_C_SOURCE
, however I do see-D_APPLE_C_SOURCE -D_XOPEN_SOURCE=600
being used, and in /usr/include/sys/cdefs.h I see that if_XOPEN_SOURCE
is defined and great than or equal to 500, then_POSIX_C_SOURCE
will be defined.So the problem seems to be that when nano's configure script checked to see what members were in the
stat
structure, it didn't use-D_XOPEN_SOURCE=600
so it saw thatst_atimespec
et al were available, but then when it tried to compile the actual program it did use-D_XOPEN_SOURCE=600
which madest_atimespec
et al unavailable. nano needs to use the same flags at configure time as it does at build time.From config.log, it looks like
-D_XOPEN_SOURCE=600
is coming from ncurses:nano may be totally unaware that a dependency like ncurses could potentially add such a flag. It may be a bug for ncurses to be doing that. What do you think, Josh?