Bug 116272

Summary: used before set + arithmetic on void *
Product: [Fedora] Fedora Reporter: d.binderman
Component: binutilsAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-19 17:14:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.