bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pointer casts in texinfo-4.7


From: Havard Eidnes
Subject: Pointer casts in texinfo-4.7
Date: Wed, 14 Jul 2004 20:38:59 +0200 (CEST)

Hi,

it appears that there are at least three non-portable pointer
casts in texinfo 4.7, which can be worked around by the diff
attached below.

Without this, when compiling for the alpha processor (or perhaps
more generally for an LP64 target), the compiler emits:

   warning: cast to pointer from integer of different size

and in my case we compile with -Werror, so this is fatal.

BTW, the cast of integer values to pointers in order to fit with
an argument list declaration leaves me with a somewhat foul taste
in my mouth...

Regards,

- Havard

------------------------------

Index: info/echo-area.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/info/echo-area.c,v
retrieving revision 1.1.1.4
retrieving revision 1.2
diff -u -r1.1.1.4 -r1.2
--- info/echo-area.c    12 Jul 2004 23:26:56 -0000      1.1.1.4
+++ info/echo-area.c    13 Jul 2004 18:30:49 -0000      1.2
@@ -938,7 +938,7 @@
       printf_to_message_buffer (completions_found_index == 1
                                 ? (char *) _("One completion:\n")
                                 : (char *) _("%d completions:\n"),
-                               (void *) completions_found_index, NULL, NULL);
+                               (void*)((intptr_t)completions_found_index), 
NULL, NULL);
 
       /* Find the maximum length of a label. */
       for (i = 0; i < completions_found_index; i++)
Index: info/session.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/info/session.c,v
retrieving revision 1.1.1.6
retrieving revision 1.2
diff -u -r1.1.1.6 -r1.2
--- info/session.c      12 Jul 2004 23:26:54 -0000      1.1.1.6
+++ info/session.c      13 Jul 2004 18:30:49 -0000      1.2
@@ -964,7 +964,7 @@
                      same as the first menu item found in this node. */
                   window_message_in_echo_area
                     ((char *) _("Moving Up %d time(s), then Next."),
-                     (void *) up_counter, NULL);
+                     (void *)((intptr_t)up_counter), NULL);
 
                   info_handle_pointer ("Next", window);
                   return;
@@ -1977,7 +1977,7 @@
     }
   else
     info_error ((char *) _("There aren't %d items in this menu."),
-        (void *) item, NULL);
+        (void *)((intptr_t)item), NULL);
 
   info_free_references (menu);
   return;
Index: info/infokey.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/texinfo/info/infokey.c,v
retrieving revision 1.1.1.4
retrieving revision 1.2
diff -u -r1.1.1.4 -r1.2
--- info/infokey.c      12 Jul 2004 23:26:52 -0000      1.1.1.4
+++ info/infokey.c      13 Jul 2004 19:02:44 -0000      1.2
@@ -641,7 +641,7 @@
                {
                  syntax_error (filename, lnum,
                       (char *) _("NUL character (^%c) not permitted"),
-                      (void *) c, NULL, NULL, NULL);
+                      (void *)((intptr_t)c), NULL, NULL, NULL);
                  error = 1;
                }
              seqstate = normal;
@@ -665,7 +665,7 @@
              if (alen == 0)
                {
                  syntax_error (filename, lnum, (char *) _("missing action 
name"),
-                      (void *) c, NULL, NULL, NULL);
+                      (void *)((intptr_t)c), NULL, NULL, NULL);
                  error = 1;
                }
              else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]