poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compiling with xlc


From: Bruno Haible
Subject: compiling with xlc
Date: Sun, 28 Feb 2021 23:39:22 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-203-generic; KDE/5.18.0; x86_64; ; )

Compiling poke 1.0+ with xlc on AIX 7.1, I get a compilation error:

libtool: compile:  xlc -q64 -qthreaded -qtls -DHAVE_CONFIG_H -I. 
-I../../libpoke -I../poke -I../gl-libpoke -I../../gl-libpoke -I../../common 
-DPKL_DEBUG -DPKGDATADIR=\"/home/haible/prefix64/share/poke\" 
-DPKGINFODIR=\"/home/haible/prefix64/share/info\" 
-DLOCALEDIR=\"/home/haible/prefix64/share/locale\" -DBUILDING_LIBPOKE 
-DJITTER_DISPATCH_SWITCH=1 -I /home/haible/poke-1.0a/jitter -I 
/home/haible/poke-1.0a/build-64-xlc/jitter -I 
/home/haible/poke-1.0a/jitter/machine/dummy -I /home/haible/prefix64/include 
-DJITTER_DISPATCH_SWITCH=1 -I /home/haible/poke-1.0a/jitter -I 
/home/haible/poke-1.0a/build-64-xlc/jitter -I 
/home/haible/poke-1.0a/jitter/machine/dummy -I /home/haible/prefix64/include 
-I/home/haible/prefix64/include -D_THREAD_SAFE -Wall -O2 -fomit-frame-pointer 
-fno-reorder-functions -fno-lto -g0 -fno-var-tracking 
-fno-var-tracking-assignments -mregnames -fno-dwarf2-cfi-asm 
-fno-reorder-functions -g -c ../../libpoke/pvm-vm2.c 
-Wp,-qmakedep=gcc,-MF.deps/libpvmjitter_la-pvm-vm2.TPlo  -DPIC -o 
.libs/libpvmjitter_la-pvm-vm2.o
xlc: 1501-289 (W) Option -Wall was incorrectly specified. The option will be 
ignored.
"/home/haible/poke-1.0a/jitter/jitter/jitter-hash.h", line 158.1: 1506-120 (W) 
Function cannot return a const qualified type.
"/home/haible/poke-1.0a/jitter/jitter/jitter-hash.h", line 237.1: 1506-120 (W) 
Function cannot return a const qualified type.
"/home/haible/poke-1.0a/jitter/jitter/jitter-hash.h", line 270.1: 1506-120 (W) 
Function cannot return a const qualified type.
"../../libpoke/pvm.jitter", line 5571.4: 1506-117 (S) Operand must be a scalar 
type.
make: 1254-004 The error code from the last command is 1.

When I look at the generated pvm-vm2.c, the error occurs in the line

  JITTER_PUSH_EXCEPTIONSTACK (ehandler);

which macroexpands to

  do { const struct pvm_exception_handler _jitter_stack_new_element_temp = 
(ehandler); (jitter_state_runtime. 
jitter_non_tos_optimized_stack_exceptionstack_top_p) [1] = (struct 
pvm_exception_handler) (_jitter_stack_new_element_temp); do { 
jitter_state_runtime. jitter_non_tos_optimized_stack_exceptionstack_top_p ++; } 
while (0); } while (0);

The error occurs because apparently you cannot cast to a struct type with
this compiler.

But in fact the cast is unnecessary, since the variable
  _jitter_stack_new_element_temp
is already of type 'const struct pvm_exception_handler'; as an rvalue it is
of type 'struct pvm_exception_handler'.

The fix is to remove the cast from the macro JITTER_STACK_NTOS_PUSH. For
symmetry, the attached patch does the same thing in the macro
JITTER_STACK_TOS_PUSH as well.

Attachment: 0002-Fix-a-compilation-error-with-xlc-on-AIX-7.1.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]