Bug 116272 - used before set + arithmetic on void *
Summary: used before set + arithmetic on void *
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-02-19 16:39 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-02-19 17:14:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2004-02-19 16:39:40 UTC
Description of problem:

I just tried to compile development package binutils-2.14.90.0.8-4

The compiler said

1.

../../binutils/objcopy.c(2058): warning #1338: arithmetic on pointer
to void or
function type
../../binutils/objcopy.c(2060): warning #1338: arithmetic on pointer
to void or
function type

The source code is

          char *from = memhunk + copy_byte;
          char *to = memhunk;
          char *end = memhunk + size;

Strictly speaking, the compiler is correct. Suggest add cast to char *
for both uses of memhunk.

2.

../../gas/stabs.c(523): remark #592: variable "buf" is used before its
value is
set

The source code is

  char *buf;
  char *tmp = file;
  char *endp = file + strlen (file);
  char *bufp = buf;

Clearly broken code. Suggest init buf before first use.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jakub Jelinek 2004-02-19 17:14:35 UTC
I've commited the fix to binutils CVS, but there is no point to
issue any errata about this, as all these warnings are harmless.
In stabs.c there is bufp = buf = a few lines bellow and the variables
aren't used before it appart fromthe bogus initialization and
GCC which is the only compiler we use to build binutils has void *
pointer arithmetics extension.
Thanks for reporting this.


Note You need to log in before you can comment on or make changes to this bug.