Mail Archives: djgpp-workers/2001/06/21/05:33:04
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 -