Skip to contentSkip to conversation

Adding default for m64/m32 handle

DISCUSSION Dan Carpenter 2 participants 4 messages Jul 26, 2012 Sparse checker

lore
Share & tools
lore
#0 lore raw

Hi Chris,

The patch 7aa79f8401f0 "Adding default for m64/m32 handle" causes a problem for variables called x86_64.

$ echo "unsigned char x86_64;" > test.c
$ ./sparse test.c
test.c:1:15: warning: missing identifier in declaration
test.c:1:15: error: Expected ; at the end of type declaration
test.c:1:15: error: got 1

regards,
dan carpenter

maintainer
#1 lore raw
Quoted 10 lines · Dan Carpenter

Hi Chris,

The patch 7aa79f8401f0 "Adding default for m64/m32 handle" causes a problem for variables called x86_64.

$ echo "unsigned char x86_64;" > test.c
$ ./sparse test.c
test.c:1:15: warning: missing identifier in declaration
test.c:1:15: error: Expected ; at the end of type declaration
test.c:1:15: error: got 1

Are you suggesting we do some thing like this patch to remove the define of x86_64?
Gcc does not seem to define x86_64.

Any objections?

Chris

lib.c +0 -2
index b4d3944..bb814f2 100644
@@ -372,8 +372,6 @@ static void handle_arch_m64_finalize(void)
                size_t_ctype = &ulong_ctype;
                ssize_t_ctype = &long_ctype;
 #ifdef __x86_64__
-               add_pre_buffer("#weak_define x86_64 1\n");
-               add_pre_buffer("#weak_define __x86_64 1\n");
                add_pre_buffer("#weak_define __x86_64__ 1\n");
 #endif
        }
#2 lore raw
Quoted 13 lines · Christopher Li
Quoted 10 lines · Dan Carpenter

Hi Chris,

The patch 7aa79f8401f0 "Adding default for m64/m32 handle" causes a problem for variables called x86_64.

$ echo "unsigned char x86_64;" > test.c
$ ./sparse test.c
test.c:1:15: warning: missing identifier in declaration
test.c:1:15: error: Expected ; at the end of type declaration
test.c:1:15: error: got 1
Quoted 5 lines

Are you suggesting we do some thing like this patch to remove the define of x86_64?
Gcc does not seem to define x86_64.

Any objections?

Thanks, that works.

regards,
dan carpenter

maintainer
#3 lore raw
Quoted 1 line · Dan Carpenter

Thanks, that works.

OK, no objects so far. I will apply it then.

Thanks

Chris