Skip to content

Commit

Permalink
Fix preprocessor warning "does not give a valid preprocessing token".
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaible committed Aug 1, 2017
1 parent d8763a7 commit cd79b0a
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 23 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2017-07-31 Bruno Haible <[email protected]>

Fix preprocessor warning "does not give a valid preprocessing token".
Reported by Reini Urban at <https://savannah.gnu.org/support/?109280>.
* common/asm-arm.sh: Don't put a colon inside the C() or L() argument.
* common/asm-i386.sh: Likewise.
* common/asm-m68k.sh: Likewise.
* common/asm-sparc.sh: Likewise.
* common/asm-x86_64.sh: Likewise.
* common/asm-arm.h (FUNBEGIN): Don't put a colon inside the C()
argument.
* common/asm-i386.hh (FUNBEGIN): Likewise.
* common/asm-m68k.h (FUNBEGIN): Likewise.
* common/asm-sparc.h (FUNBEGIN): Likewise.
* common/asm-x86_64.h (FUNBEGIN): Likewise.

2017-07-31 Bruno Haible <[email protected]>

Fix preprocessor warning "Unknown preprocessing directive".
Expand Down
2 changes: 1 addition & 1 deletion common/asm-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
#define DECLARE_FUNCTION(name)
#define FUNEND(name)
#endif
#define FUNBEGIN(name) C(name##:)
#define FUNBEGIN(name) C(name):
6 changes: 3 additions & 3 deletions common/asm-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ s,@,//,g
# ----------- Turn # into $, to avoid trouble in preprocessing
s,#,\$,g
# ----------- Global symbols depends on ASM_UNDERSCORE
s/^\([A-Za-z0-9_:]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_:]\+\)/L(\1)/
s/^\([A-Za-z0-9_]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_]\+\)/L(\1)/
s/\.global[ ]\([A-Za-z0-9_]*\)/.global C(\1)/
# ----------- Introduce macro syntax for assembler pseudo-ops
/\.file\([ ]\+\)/d
/\.section\([ ]\+\).*GNU-stack/d
s/^C(\([A-Za-z0-9_]*\):)/FUNBEGIN(\1)/
s/^C(\([A-Za-z0-9_]*\)):/FUNBEGIN(\1)/
# ----------- Massage the beginning of functions
/\.type/{
s/\.type[ ]\([A-Za-z0-9_]*\), *function/DECLARE_FUNCTION(\1)/
Expand Down
2 changes: 1 addition & 1 deletion common/asm-i386.hh
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
#define FUNBEGIN(name) __declspec(naked) void name () { __asm {
#define FUNEND(name,size_expression) } }
#else
#define FUNBEGIN(name) C(name##:)
#define FUNBEGIN(name) C(name):
#if defined(BSD_SYNTAX)
#define FUNEND(name,size_expression)
#else
Expand Down
6 changes: 3 additions & 3 deletions common/asm-i386.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ EOF

cat > $tmpscript03 << \EOF
# ----------- Global symbols depends on ASM_UNDERSCORE
s/^\([A-Za-z0-9_:]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_:]\+\)/L(\1)/
s/^\([A-Za-z0-9_]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_]\+\)/L(\1)/
# ----------- Massage the beginning of functions
/\.type/{
s/\.type \([A-Za-z0-9_]*\), *@function/DECLARE_FUNCTION(\1)/
Expand Down Expand Up @@ -164,7 +164,7 @@ s/\.text/TEXT()/
s/^\([^#]*\)\.align \(.*\)/\1ALIGN(\2)/
s/\.p2align \([^,]*\),,\(.*\)/P2ALIGN(\1,\2)/
s/\.globl\( \+\)\(.*\)$/GLOBL(C(\2))/
s/^C(\([A-Za-z0-9_]*\):)/FUNBEGIN(\1)/
s/^C(\([A-Za-z0-9_]*\)):/FUNBEGIN(\1)/
# The next 5 lines add FUNEND() after each ret followed by an empty line
/[ ]ret *$/{
n
Expand Down
2 changes: 1 addition & 1 deletion common/asm-m68k.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
#define DECLARE_FUNCTION(name)
#define FUNEND(name)
#endif
#define FUNBEGIN(name) C(name##:)
#define FUNBEGIN(name) C(name):
12 changes: 6 additions & 6 deletions common/asm-m68k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ EOF
if test $syntax = mit; then
cat > $tmpscript2 << \EOF
# ----------- Global symbols depends on ASM_UNDERSCORE
s/^L\([A-Za-z0-9_:]\+\)/L(\1)/
s/^L\([A-Za-z0-9_]\+\)/L(\1)/
s/ L\([A-Za-z0-9_]\+\)/ L(\1)/
# ----------- Prefix register names with $, to be turned into % later
s/,/, /g
Expand All @@ -58,8 +58,8 @@ s/, /,/g
s/\.globl[ ]_\([A-Za-z0-9_]*\)$/.globl _\1\
DECLARE_FUNCTION(\1)/
# ----------- Global symbols depends on ASM_UNDERSCORE
s/_\([A-Za-z0-9_:]*\)/C(\1)/
s/^C(\([A-Za-z0-9_]*\):)/FUNBEGIN(\1)/
s/_\([A-Za-z0-9_]*\)/C(\1)/
s/^C(\([A-Za-z0-9_]*\)):/FUNBEGIN(\1)/
/FUNBEGIN(/{
h
}
Expand All @@ -75,12 +75,12 @@ fi
if test $syntax = motorola; then
cat > $tmpscript2 << \EOF
# ----------- Global symbols depends on ASM_UNDERSCORE
s/^\([A-Za-z0-9_:]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_:]\+\)/L(\1)/
s/^\([A-Za-z0-9_]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_]\+\)/L(\1)/
s/\.globl[ ]\([A-Za-z0-9_]*\)/.globl C(\1)/
# ----------- Introduce macro syntax for assembler pseudo-ops
/\.file\([ ]\+\)/d
s/^C(\([A-Za-z0-9_]*\):)/FUNBEGIN(\1)/
s/^C(\([A-Za-z0-9_]*\)):/FUNBEGIN(\1)/
# ----------- Massage the beginning of functions
/\.type/{
s/\.type[ ]\([A-Za-z0-9_]*\), *@function/DECLARE_FUNCTION(\1)/
Expand Down
2 changes: 1 addition & 1 deletion common/asm-sparc.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
#define DECLARE_FUNCTION(name)
#define FUNEND(name)
#endif
#define FUNBEGIN(name) C(name##:)
#define FUNBEGIN(name) C(name):
6 changes: 3 additions & 3 deletions common/asm-sparc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ EOF

cat > $tmpscript2 << \EOF
# ----------- Global symbols depends on ASM_UNDERSCORE
s/^\([A-Za-z0-9_:]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_:]\+\)/L(\1)/
s/^\([A-Za-z0-9_]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_]\+\)/L(\1)/
s/\.global[ ]\([A-Za-z0-9_]*\)$/.global C(\1)/
# ----------- Introduce macro syntax for assembler pseudo-ops
/\.file\([ ]\+\)/d
/\.section\([ ]\+\).*GNU-stack/d
s/^C(\([A-Za-z0-9_]*\):)/FUNBEGIN(\1)/
s/^C(\([A-Za-z0-9_]*\)):/FUNBEGIN(\1)/
# ----------- Massage the beginning of functions
/\.type/{
s/\.type[ ]\([A-Za-z0-9_]*\), *#function/DECLARE_FUNCTION(\1)/
Expand Down
2 changes: 1 addition & 1 deletion common/asm-x86_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#define FUNEND(name,size_expression) .size C(name),size_expression
#endif
#endif
#define FUNBEGIN(name) C(name##:)
#define FUNBEGIN(name) C(name):

// Section of frame info for exception handlers
#if defined __APPLE__ && defined __MACH__
Expand Down
6 changes: 3 additions & 3 deletions common/asm-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ EOF

cat > $tmpscript2 << \EOF
# ----------- Global symbols depends on ASM_UNDERSCORE
s/^\([A-Za-z0-9_:]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_:]\+\)/L(\1)/
s/^\([A-Za-z0-9_]\+\)/C(\1)/
s/\.L\([A-Za-z0-9_]\+\)/L(\1)/
s/\.globl \([A-Za-z0-9_]*\)/.globl C(\1)/
s/\([A-Za-z0-9_]\+\)(%rip)/C(\1)(%rip)/
# ----------- Massage the beginning of functions
Expand Down Expand Up @@ -66,7 +66,7 @@ cat > $tmpscript3 << \EOF
# ----------- Introduce macro syntax for assembler pseudo-ops
s/\.p2align \([^,]*\),,\(.*\)/P2ALIGN(\1,\2)/
/\.section\([ ]\+\).*GNU-stack/d
s/^C(\([A-Za-z0-9_]*\):)/FUNBEGIN(\1)/
s/^C(\([A-Za-z0-9_]*\)):/FUNBEGIN(\1)/
EOF

sed -f $tmpscript1 | \
Expand Down

0 comments on commit cd79b0a

Please sign in to comment.