------- Comment #6 from rearnsha at gcc dot gnu dot org  2009-02-10 14:36 
-------
This is not a bug, but a problem with your source code.

In order to understand why, you need to pre-process the code and look at the
output:

...
void *memset_arm9(void *a, int b, int c)
{
  return ({ uint8_t *dst = ((uint8_t *)a); uint8_t c = (b); int count = (c);
uin
t32_t dummy0, dummy1, dummy2; __asm__ __volatile__ (

Notice that first there is a declaration of a variable c (uint8_t), then in the
next statement there is a use of c.  This use (which is intended to be of the
formal parameter passed to memset_arm9 is instead interpreted as the newly
declared variable c (the uint8 one).


Compiling your testcase with -Wshadow gives:

inl.c: In function 'memset_arm9':
inl.c:66: warning: declaration of 'c' shadows a parameter
inl.c:64: warning: shadowed declaration is here


-- 

rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rearnsha at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31693

Reply via email to