[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more m4 underquotations
From: |
Bruno Haible |
Subject: |
Re: more m4 underquotations |
Date: |
Wed, 14 Feb 2007 00:18:11 +0100 |
User-agent: |
KMail/1.5.4 |
Hello Ralf,
Three bugs found by simple inspection! Wow!
> 2007-02-13 Ralf Wildenhues <address@hidden>
>
> * m4/intdiv0.m4 (gt_INTDIV0): Fix m4 quoting bug.
Thanks; I'm applying an equivalent patch.
> If you prefer some other quoting style (e.g., maximal quoting or
> quadrigraphs, but rather not changequote)
There is an important property that programming languages should have:
the ability to copy and paste a piece of code from one place to another.
- Why was PASCAL's compound statement
BEGIN stmt1 ; stmt2 ; ... ; stmtN END
so weird? Because when copying or removing the last statement of a
compound statement, you had to add or remove a semicolon, nearly always.
- Why is it so heavy to move a C++ method declaration from inside a
class to outside? Because the syntax is different:
inside: int foo (arg1...) { ... }
outside: [inline] int bar::foo (arg1...) { ... }
- Why was LaTeX so unreliable in the first years? Because when you had a
string like {\"{U}berschrift} and it was copied to a page header or an
index, you suddenly needed to add \protect here and there, such as
{\protect\"{U}berschrift}.
changequote does have this property to a large extent: You can move a piece
of code that uses changequote between an "unquoted" context and a
"single-quoted" context without modifications, and you can also copy/paste
to a shell if you remove the (easily visible) changequote lines and comment
lines.
Quadrigraphs don't have this property as much: You can move a piece of code
between an "unquoted" context, a "single-quoted" context or a "doubly-quoted"
context without modifications. But no easy copy/paste to a shell.
[[...]] doesn't have this property at all.
Bruno
2007-02-13 Bruno Haible <address@hidden>
* m4/intdiv0.m4 (gt_INTDIV0): Assume ANSI C. Fix underquoting bug.
Reported by Ralf Wildenhues <address@hidden>.
*** m4/intdiv0.m4 24 Feb 2005 20:12:45 -0000 1.4
--- m4/intdiv0.m4 13 Feb 2007 22:42:35 -0000
***************
*** 1,5 ****
! # intdiv0.m4 serial 1 (gettext-0.11.3)
! dnl Copyright (C) 2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
--- 1,5 ----
! # intdiv0.m4 serial 2 (gettext-0.16.2)
! dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
***************
*** 19,29 ****
#include <signal.h>
static void
- #ifdef __cplusplus
sigfpe_handler (int sig)
- #else
- sigfpe_handler (sig) int sig;
- #endif
{
/* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
exit (sig != SIGFPE);
--- 19,25 ----
***************
*** 53,64 ****
--- 49,62 ----
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
[
# Guess based on the CPU.
+ changequote(,)dnl
case "$host_cpu" in
alpha* | i[34567]86 | m68k | s390*)
gt_cv_int_divbyzero_sigfpe="guessing yes";;
*)
gt_cv_int_divbyzero_sigfpe="guessing no";;
esac
+ changequote([,])dnl
])
])
case "$gt_cv_int_divbyzero_sigfpe" in