Discussion:
M2C & gcc-5.x
(too old to reply)
Saša Janiška
2015-12-19 09:17:49 UTC
Permalink
Raw Message
Hello,

yesterday while chatting with Benjamin, I found out that M2C does no
compile with default gcc-5.3 on Debian Sid, although it built with gcc-
4.9, so I'll be curious if someone was able to build with gcc-5.x?


Sincerely,
Gour

p.s. Btw, it's nice to see some live here and let's hope that R10 bill
bring new life into M2 community, so "Modula-2 users of the world,
unite!"
--
You have a right to perform your prescribed duty, but you
are not entitled to the fruits of action. Never consider
yourself the cause of the results of your activities,
and never be attached to not doing your duty.
trijezdci
2015-12-19 09:53:48 UTC
Permalink
Raw Message
Post by Saša Janiška
Hello,
yesterday while chatting with Benjamin, I found out that M2C does no
compile with default gcc-5.3 on Debian Sid, although it built with gcc-
4.9, so I'll be curious if someone was able to build with gcc-5.x?
Sincerely,
Gour
p.s. Btw, it's nice to see some live here and let's hope that R10 bill
bring new life into M2 community, so "Modula-2 users of the world,
unite!"
--
You have a right to perform your prescribed duty, but you
are not entitled to the fruits of action. Never consider
yourself the cause of the results of your activities,
and never be attached to not doing your duty.
all the errors gcc5 reports relate to getter functions with an inline attribute. There appears to have been a change in how gcc5 handles inline functions. Note that inline is ISO C while gcc has its own __inline__ with different semantics. The inline attribute works with LLVM as before. Not sure how to tackle this one other than removing the inline attribute altogether. Maybe somebody else has an idea.
r***@gmail.com
2015-12-19 10:14:36 UTC
Permalink
Raw Message
Hi,
Post by trijezdci
all the errors gcc5 reports relate to getter functions with an
inline attribute. There appears to have been a change in how gcc5
handles inline functions. Note that inline is ISO C while gcc has
its own __inline__ with different semantics. The inline attribute
works with LLVM as before. Not sure how to tackle this one other
than removing the inline attribute altogether. Maybe somebody
else has an idea.
Blind guess, but see the bit about "-fgnu89-inline". This kind of
thing has bitten people before.

https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
Saša Janiška
2015-12-22 11:30:51 UTC
Permalink
Raw Message
Post by r***@gmail.com
Blind guess, but see the bit about "-fgnu89-inline". This kind of
thing has bitten people before.
That helps indeed...only some warnings:

***@atmarama ~/r/e/m2c-rework> make
gcc -MM m2-lexer.c m2-filereader.c m2-fileutils.c m2-token.c m2-
tokenset.c m2-error.c m2-production.c m2-resync-sets.c m2-parser.c m2-
unique-string.c m2-compiler-options.c m2c.c m2-lexer.c m2-filereader.c
m2-fileutils.c m2-token.c m2-tokenset.c m2-error.c m2-unique-string.c
m2-compiler-options.c testlex.c m2-token.c m2-tokenset.c
gen_first_sets.c m2-token.c m2-tokenset.c gen_follow_sets.c m2-token.c
m2-tokenset.c gen_resync_sets.c m2-token.c m2-tokenset.c m2-production.c
m2-error.c m2-compiler-options.c print_first_sets.c m2-token.c m2-
tokenset.c m2-production.c m2-error.c m2-compiler-options.c
print_follow_sets.c > depends.mk
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-lexer.c -o m2-lexer.o
m2-lexer.c: In function ‘skip_block_comment’:
m2-lexer.c:935:19: warning: unused variable ‘quote’ [-Wunused-variable]
   char next_char, quote;
                   ^
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-filereader.c -o m2-
filereader.o
m2-filereader.c: In function ‘m2c_la2_char’:
m2-filereader.c:520:12: warning: ‘index’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
   if (index+1 == infile->buflen) {
            ^
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-fileutils.c -o m2-
fileutils.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-token.c -o m2-token.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-tokenset.c -o m2-
tokenset.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-error.c -o m2-error.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-production.c -o m2-
production.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-resync-sets.c -o m2-
resync-sets.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-parser.c -o m2-parser.o
m2-parser.c: In function ‘unqualified_import’:
m2-parser.c:545:16: warning: variable ‘module_ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t module_ident;
                ^
m2-parser.c: In function ‘ident_list’:
m2-parser.c:583:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘const_definition’:
m2-parser.c:719:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘type_definition’:
m2-parser.c:753:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘qualident’:
m2-parser.c:909:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘countable_type’:
m2-parser.c:1049:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘variant_fields’:
m2-parser.c:1448:23: warning: variable ‘type_ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident, type_ident;
                       ^
m2-parser.c:1448:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident, type_ident;
                ^
m2-parser.c: In function ‘procedure_signature’:
m2-parser.c:1896:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘type_declaration’:
m2-parser.c:2423:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘var_size_record_type’:
m2-parser.c:2468:32: warning: variable ‘size_field’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t var_size_field, size_field;
                                ^
m2-parser.c:2468:16: warning: variable ‘var_size_field’ set but not used
[-Wunused-but-set-variable]
   m2c_string_t var_size_field, size_field;
                ^
m2-parser.c: In function ‘procedure_declaration’:
m2-parser.c:2625:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘for_statement’:
m2-parser.c:3534:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘selector’:
m2-parser.c:3651:16: warning: variable ‘ident’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t ident;
                ^
m2-parser.c: In function ‘factor’:
m2-parser.c:3907:16: warning: variable ‘lexeme’ set but not used [-
Wunused-but-set-variable]
   m2c_string_t lexeme;
                ^
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-unique-string.c -o m2-
unique-string.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2-compiler-options.c -o
m2-compiler-options.o
gcc -c -Wall -Wno-comments -g -fgnu89-inline m2c.c -o m2c.o
gcc   m2-lexer.o m2-filereader.o m2-fileutils.o m2-token.o m2-tokenset.o
m2-error.o m2-production.o m2-resync-sets.o m2-parser.o m2-unique-
string.o m2-compiler-options.o m2c.o -o m2c
gcc -c -Wall -Wno-comments -g -fgnu89-inline testlex.c -o testlex.o
gcc   m2-lexer.o m2-filereader.o m2-fileutils.o m2-token.o m2-tokenset.o
m2-error.o m2-unique-string.o m2-compiler-options.o testlex.o -o testlex
gcc -c -Wall -Wno-comments -g -fgnu89-inline gen_first_sets.c -o
gen_first_sets.o
gcc   m2-token.o m2-tokenset.o gen_first_sets.o -o gen_first_sets
gcc -c -Wall -Wno-comments -g -fgnu89-inline gen_follow_sets.c -o
gen_follow_sets.o
gcc   m2-token.o m2-tokenset.o gen_follow_sets.o -o gen_follow_sets
gcc -c -Wall -Wno-comments -g -fgnu89-inline gen_resync_sets.c -o
gen_resync_sets.o
gcc   m2-token.o m2-tokenset.o gen_resync_sets.o -o gen_resync_sets
gcc -c -Wall -Wno-comments -g -fgnu89-inline print_first_sets.c -o
print_first_sets.o
gcc   m2-token.o m2-tokenset.o m2-production.o m2-error.o m2-compiler-
options.o print_first_sets.o -o print_first_sets
gcc -c -Wall -Wno-comments -g -fgnu89-inline print_follow_sets.c -o
print_follow_sets.o
gcc   m2-token.o m2-tokenset.o m2-production.o m2-error.o m2-compiler-
options.o print_follow_sets.o -o print_follow_sets


Sincerely,
Gour
--
Everyone is forced to act helplessly according to the qualities
he has acquired from the modes of material nature; therefore no
one can refrain from doing something, not even for a moment.
Loading...