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

Solaris 11.4 Compile: error: ‘struct std::tm’ has no member named ‘tm_gmtoff’ #498

Closed
johnkwoods opened this issue Dec 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working platform issue Issue is specific to an OS or desktop priority-low
Milestone

Comments

@johnkwoods
Copy link

johnkwoods commented Dec 26, 2022

When compiling htmldoc 1.9.16 from source, on Solaris 11.4.51.132.1, with gcc 12.1.0, the htmldoc/ps-pdf.cxx file fails to compile:

gmake

Making all in htmldoc...
gmake[1]: Entering directory '/tmp/htmldoc-1.9.16-SunOS-5.11-i386/htmldoc'
Compiling gui.cxx...
Compiling epub.cxx...
Compiling html.cxx...
Compiling htmldoc.cxx...
Compiling htmlsep.cxx...
Compiling license.cxx...
Compiling markdown.cxx...
Compiling mmd.c...
cc1: warning: command-line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C
mmd.c: In function ‘mmdCopyAllText’:
mmd.c:208:33: warning: pointer ‘all’ may be used after ‘realloc’ [-Wuse-after-free]
208 | allptr = temp + (allptr - all);
| ~~~~~~~~^~~~~~
mmd.c:200:19: note: call to ‘realloc’ here
200 | temp = realloc(all, allsize);
| ^~~~~~~~~~~~~~~~~~~~~
Compiling ps-pdf.cxx...
ps-pdf.cxx: In function ‘void pdf_write_links(std::FILE*)’:
ps-pdf.cxx:3469:28: warning: comparison of integer expressions of different signedness: ‘short int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
3469 | if (link->page < num_pages)
| ~~~~~~~~~~~^~~~~~~~~~~
ps-pdf.cxx: In function ‘void write_prolog(std::FILE*, int, uchar*, uchar*, uchar*, uchar*, uchar*)’:
ps-pdf.cxx:11656:28: error: ‘struct std::tm’ has no member named ‘tm_gmtoff’
11656 | (int)(doc_date.tm_gmtoff / 3600));
| ^~~~~~~~~
ps-pdf.cxx:12045:28: error: ‘struct std::tm’ has no member named ‘tm_gmtoff’
12045 | (int)(doc_date.tm_gmtoff / 3600));
| ^~~~~~~~~
gmake[1]: *** [../Makedefs:92: ps-pdf.o] Error 1
gmake[1]: Leaving directory '/tmp/htmldoc-1.9.16-SunOS-5.11-i386/htmldoc'
gmake: *** [Makefile:31: all] Error 1

Upon research, I was able to compile htmldoc 2.9.15 just fine with the same configuration.

I believe this is related to the two following issues/commits:
543d6e3
#472

On Solaris, in /usr/include/iso/time_iso.h, the struct does not contain tm_gmtoff:

struct  tm {    /* see ctime(3) */
        int     tm_sec;
        int     tm_min;
        int     tm_hour;
        int     tm_mday;
        int     tm_mon;
        int     tm_year;
        int     tm_wday;
        int     tm_yday;
        int     tm_isdst;
};

I noticed that in the configure output, there is a line to detect whether tm_gmtoff exists, while setting HAVE_TM_GMTOFF:

checking for tm_gmtoff member in tm structure... no

I'd imagine you probably don't have a spare Solaris server to compile on, so please let me know if you need me to test compile a fix.

Thanks again for creating/maintaining a great tool!!!

michaelrsweet added a commit that referenced this issue Sep 13, 2023
@michaelrsweet michaelrsweet self-assigned this Sep 13, 2023
@michaelrsweet michaelrsweet added bug Something isn't working platform issue Issue is specific to an OS or desktop priority-low labels Sep 13, 2023
@michaelrsweet michaelrsweet added this to the Stable milestone Sep 13, 2023
@michaelrsweet
Copy link
Owner

[master 3cdeb68] Fix Solaris builds (Issue #498)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform issue Issue is specific to an OS or desktop priority-low
Projects
None yet
Development

No branches or pull requests

2 participants