delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2013/03/24/09:15:37

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:x-received:in-reply-to:references:date:message-id
:subject:from:to:content-type;
bh=ToP/JpS1VqO5hpCflj1vJpP6dcuvjO32taOxeiCFwzU=;
b=sHQoC7HJkEyFgXeM3PbbLjSCHFlkj3NgD7uCeh4lUgB3xp9RiTez2a1pd30O3wvr8u
novMtoqI8mFSaPmjcn4lutyI+EhHuZMOcj8PynGUrAe6nxcGsaNcctD9+cxrjiNFd+bj
r5nTfqogBBdgFdIsZOJvAOfL+TeCWVsz6JPTQB2VQw8YCkS4NhDbxo0OFdzHnoOPE3K3
0mgyCyg0NVnTni1+DWFyR1otn1hZpbIVh2xRzPpjjW7h5T3GW73L10cmTXiJ1Jkn6T+X
d8/3bSd8q9Th+uHibqHrV7FtQpfDf87AhIBtH5EC4LQ9as2dC87buQGLERiYOQxh1Ff7
p+HQ==
MIME-Version: 1.0
X-Received: by 10.68.254.69 with SMTP id ag5mr12231685pbd.31.1364130923702;
Sun, 24 Mar 2013 06:15:23 -0700 (PDT)
In-Reply-To: <514EADD8.3080902@iki.fi>
References: <5140A042 DOT 9050805 AT iki DOT fi>
<514EADD8 DOT 3080902 AT iki DOT fi>
Date: Sun, 24 Mar 2013 15:15:23 +0200
Message-ID: <CAA2C=vA5WwUBx=ek49qOGVZH-uGfYgW5RyaC8fBzEE4CZJ3FDg@mail.gmail.com>
Subject: Re: About new DJGPP v2.04 beta
From: Ozkan Sezer <sezeroz AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 3/24/13, Andris Pavenis <andris DOT pavenis AT iki DOT fi> wrote:
> On 03/13/2013 05:50 PM, Andris Pavenis wrote:
>> I guess we should make a new DJGPP v2.04 beta soon
>> and most likely do a release also sometimes
>> in not too far future
>

Here are some minor warnings/issues I encountered with the current cvs:

*  djasm.y emits const warnings: (gcc-4.8)

djasm-n.c: In function 'yyparse':
djasm-n.c:5481:9: warning: passing argument 1 of 'yyerror' discards
'const' qualifier from pointer target type [enabled by default]
         yyerror (yymsgp);
         ^
djasm.y:41:6: note: expected 'char *' but argument is of type 'const char *'
 void yyerror(char *s);
      ^
i586-pc-msdosdjgpp-ar: creating ./../../lib/libc.a
i586-pc-msdosdjgpp-ar: creating ./../../lib/libdbg.a
djasm.c: In function 'yyparse':
djasm.c:5481:9: warning: passing argument 1 of 'yyerror' discards
'const' qualifier from pointer target type [enabled by default]
         yyerror (yymsgp);
         ^
djasm.y:41:6: note: expected 'char *' but argument is of type 'const char *'
 void yyerror(char *s);
      ^

Constification, something like the following, cures the warnings:

Index: src/djasm/djasm.y
===================================================================
RCS file: /cvs/djgpp/djgpp/src/djasm/djasm.y,v
retrieving revision 1.12
diff -u -p -r1.12 djasm.y
--- src/djasm/djasm.y	30 Dec 2011 16:09:42 -0000	1.12
+++ src/djasm/djasm.y	24 Mar 2013 10:51:41 -0000
@@ -37,8 +37,8 @@
 #define MAX(a,b) ((a)>(b)?(a):(b))
 #define MIN(a,b) ((a)<(b)?(a):(b))

-void djerror(char *s);
-void yyerror(char *s);
+void djerror(const char *s);
+void yyerror(const char *s);
 void shxd_error(int opcode);

 #define OUT_exe 0
@@ -1677,14 +1677,14 @@ int main(int argc, char **argv)
   return 0;
 }

-void djerror(char *s)
+void djerror(const char *s)
 {
   fprintf(stderr, "%s:%d: %s\n", inname, lineno, s);
   strbuf[strbuflen] = 0;
   total_errors++;
 }

-void yyerror(char *s)
+void yyerror(const char *s)
 {
   djerror(s);
   fprintf(stderr, "%s:%d: Last token was `%s' (%s)\n", inname,
lineno, last_token, yytname[(unsigned char)yytranslate[last_tret]]);


*  With bison 2.3 from x86-fedora9, I get another warning from djasm.y:
djasm.y:706.11-714.14: warning: unused value: $4

... whereas with bison 2.5 from x86_64-fedora16, there are no warnings.
I am not good with bison, so I don't know what the issue here is.


* zoneinfo/src cannot be cross-built with oldish gcc: (host compiler:
gcc-4.3.0, dj-compiler: gcc-3.4.6)

cc1: error: unrecognized command line option "-Wno-sign-conversion"
cc1: error: unrecognized command line option "-Wno-type-limits"
cc1: error: unrecognized command line option "-Woverlength-strings"
cc1: error: unrecognized command line option "-Wsuggest-attribute=const"
cc1: error: unrecognized command line option "-Wsuggest-attribute=noreturn"
cc1: error: unrecognized command line option "-Wsuggest-attribute=pure"
cc1: error: unrecognized command line option "-Wtrampolines"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
cc1: error: unrecognized command line option "-Wno-type-limits"
cc1: error: unrecognized command line option "-Woverlength-strings"
cc1: error: unrecognized command line option "-Wsuggest-attribute=const"
cc1: error: unrecognized command line option "-Wsuggest-attribute=noreturn"
cc1: error: unrecognized command line option "-Wsuggest-attribute=pure"
cc1: error: unrecognized command line option "-Wtrampolines"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
cc1: error: unrecognized command line option "-Wno-type-limits"
cc1: error: unrecognized command line option "-Woverlength-strings"
cc1: error: unrecognized command line option "-Wsuggest-attribute=const"
cc1: error: unrecognized command line option "-Wsuggest-attribute=noreturn"
cc1: error: unrecognized command line option "-Wsuggest-attribute=pure"
cc1: error: unrecognized command line option "-Wtrampolines"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
cc1: error: unrecognized command line option "-Wno-type-limits"
cc1: error: unrecognized command line option "-Woverlength-strings"
cc1: error: unrecognized command line option "-Wsuggest-attribute=const"
cc1: error: unrecognized command line option "-Wsuggest-attribute=noreturn"
cc1: error: unrecognized command line option "-Wsuggest-attribute=pure"
cc1: error: unrecognized command line option "-Wtrampolines"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
cc1: error: unrecognized command line option "-Wno-type-limits"
cc1: error: unrecognized command line option "-Woverlength-strings"
cc1: error: unrecognized command line option "-Wsuggest-attribute=const"
cc1: error: unrecognized command line option "-Wsuggest-attribute=noreturn"
cc1: error: unrecognized command line option "-Wsuggest-attribute=pure"
cc1: error: unrecognized command line option "-Wtrampolines"
make[1]: *** [host-zic] Error 1

The ultra-overzealus warning flags obviously need some work.

--
O.S.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019