From: Alex <agrambot@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 34849@debbugs.gnu.org
Subject: bug#34849: Compilation issues with g++ on some files
Date: Sat, 16 Mar 2019 23:22:11 -0600 [thread overview]
Message-ID: <874l82krcs.fsf@gmail.com> (raw)
In-Reply-To: <8736nqzdfe.fsf@gmail.com> (Alex's message of "Wed, 13 Mar 2019 15:12:37 -0600")
Alex <agrambot@gmail.com> writes:
> I'm currently working on a prototype for a feature that requires the
> introduction of C++ files, and I am having some issues compiling certain
> files with g++. Any chance the below (particularly #3) could be easily
> fixed?
>
> 1. Invalid conversions to pvec_type. Compiling with the -fpermissive
> flag demotes these to warnings, but it would be nice to avoid using
> that.
>
> ./src/lisp.h: In function ‘pvec_type PSEUDOVECTOR_TYPE(const Lisp_Vector*)’:
> ./src/lisp.h:1683:11: error: invalid conversion from ‘long int’ to ‘pvec_type’ [-fpermissive]
> return (size & PSEUDOVECTOR_FLAG
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> ? (size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : PVEC_NORMAL_VECTOR);
> ~~~~~~~~~~~~~~~~~~~~~
> ./src/lisp.h: In function ‘bool PSEUDOVECTORP(Lisp_Object, int)’:
> ./src/lisp.h:1708:6: error: invalid conversion from ‘int’ to ‘pvec_type’ [-fpermissive]
> code);
> ^~~~
>
>
> 2. This one just needs a new (not new) variable name.
>
> ./src/lisp.h:1585:58: error: expected ‘,’ or ‘...’ before ‘new’
> SSET (Lisp_Object string, ptrdiff_t index, unsigned char new)
> ^~~
> ./src/lisp.h: In function ‘void SSET(Lisp_Object, ptrdiff_t, unsigned char)’:
> ./src/lisp.h:1587:30: error: expected type-specifier before ‘;’ token
> SDATA (string)[index] = new;
> ^
>
>
> 3. I'm not sure what to do for the next one, which is unfortunately
> included by other files.
>
> ./lib/time.h:769:1: error: expected ‘,’ or ‘...’ before ‘__timer’
> _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
> ^~~~~~~~~~~~~~~~
> ./lib/time.h:771:50: error: nonnull argument with out-of-range operand number (argument 2, operand 3)
> struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
> ^~~~~~~~~~~~~~~
> ./lib/time.h:775:1: error: expected ‘,’ or ‘...’ before ‘__result’
> _GL_FUNCDECL_SYS (mktime_z, time_t,
> ^~~~~~~~~~~~~~~~
I managed to work around #3 by editing lib/time.h.in directly, but now
I've hit another issue: compiling lisp.h inside of an extern "C" block.
This gets me the following error:
--8<---------------cut here---------------start------------->8---
./lib/verify.h:178:1: error: template with C linkage
template <int w>
--8<---------------cut here---------------end--------------->8---
Paul, do you have any ideas on how to fix this? Is there a solution
that works both when __cplusplus is defined and when using C linkage?
next prev parent reply other threads:[~2019-03-17 5:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 21:12 bug#34849: Compilation issues with g++ on some files Alex
2019-03-17 5:22 ` Alex [this message]
2019-03-18 1:47 ` Richard Stallman
2019-03-18 16:18 ` Alex
2019-03-19 2:24 ` Richard Stallman
2019-03-19 2:37 ` Paul Eggert
2019-03-19 4:45 ` Alex
2019-03-19 7:33 ` Eli Zaretskii
2019-03-20 2:12 ` Paul Eggert
2019-03-20 6:04 ` Alex
2019-03-20 7:05 ` Eli Zaretskii
2019-03-20 6:38 ` Eli Zaretskii
2019-03-20 2:31 ` Richard Stallman
2019-03-20 6:53 ` Eli Zaretskii
2019-03-21 2:09 ` Richard Stallman
2019-03-20 2:32 ` Richard Stallman
2019-03-20 10:53 ` Dmitry Gutov
2019-03-21 2:10 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874l82krcs.fsf@gmail.com \
--to=agrambot@gmail.com \
--cc=34849@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.