[PATCH] Avoid pointer arithmetic on `void *'.

Ralf Wildenhues <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Organization Department of Numerical Simulation, University of Bonn
Message-ID <[email protected]>
* modules/m4.c (dump_symbol_CB): Cast obstack_base return value
to `char *' before using it.

Signed-off-by: Ralf Wildenhues <[email protected]>
---

Hi Eric,

found this while trying to build master on Tru64/OSF1, where the
compiler warns about void * arithmetic by default.

Cheers,
Ralf

 modules/m4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/m4.c b/modules/m4.c
index f3cfc94..1d0d7c4 100644
--- a/modules/m4.c
+++ b/modules/m4.c
@@ -279,7 +279,7 @@ dump_symbol_CB (m4_symbol_table *ignored M4_GNUC_UNUSED, const char *name,
       obstack_blank (symbol_data->obs, sizeof *symbol_data->base);
       symbol_data->size = (obstack_room (symbol_data->obs)
 			   / sizeof *symbol_data->base);
-      symbol_data->base = (m4_string *) (obstack_base (symbol_data->obs)
+      symbol_data->base = (m4_string *) ((char *) obstack_base (symbol_data->obs)
 					 + offset);
     }
   else
-- 
1.6.3.2.199.g31f34
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.