www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/21/05:33:04

From: pavenis AT lanet DOT lv
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Thu, 21 Jun 2001 11:23:53 +0300
MIME-Version: 1.0
Subject: Re: Mysterious id in dbgcom.c
Message-ID: <3B31D949.8451.538478@localhost>
References: <3B30EF23 DOT 3036DEF0 AT phekda DOT freeserve DOT co DOT uk>
In-reply-to: <Pine.SUN.3.91.1010621103516.7710H-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

On 21 Jun 2001, at 10:35, Eli Zaretskii wrote:

> 
> On Wed, 20 Jun 2001, Richard Dawe wrote:
> 
> > > > dbgcom.c:36: warning: `id' defined but not used
> > > >
> > > > What good is it? Some version control or something?
> > > 
> > > Yes.  See src/ident.c and src/makefile.lib
> > > 
> > > You need the 'id' in that file to force the ident string (in id_dbg.o)
> > > to get pulled in to every executable using that library.
> > 
> > Perhaps you could put '__attribute__((unused))' on id's definition, to
> > stop gcc from generating the warning?
> 
> I don't think this will work, but maybe it's worth to try.
> 
> If not, just throw in some dummy line, like "id = id;", to shut up the
> compiler.

It's very simple to silence GCC not to warn about unused 'id'.
I used such way with gcc-2.95.X. Verified now in dbgcom.c with
gcc-3.0. However dbgcom.c needs cleanup for gcc-3.0 as gcc-3.0
gives many warnings of type:

dbgcom.c:113:8: warning: multi-line string literals are deprecated

And dbgcom.c is not only such file. Currently it doesn't happen 
in files which are compiled using option -Werror though


Andris

*** djgpp/src/debug/common/dbgcom.c~7	Thu Jan  4 23:39:12 2001
--- djgpp/src/debug/common/dbgcom.c	Thu Jun 21 11:18:40 2001
***************
*** 1692,1697 ****
--- 1692,1699 ----
    int jft_ofs;
    int jft_count;
  
+   (void) id;
+ 
    /* Get our PSP address.  */
    r.x.ax = 0x6200;
    __dpmi_int (0x21, &r);

- Raw text -


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