Skip to contentSkip to conversation

src/execstack.c: fix prelink_path type

prelink-cross James Hilliard 1 participant 2 messages May 31, 2024 – Jun 27, 2024

lore
Share & tools
lore
#0 lore raw

Fixes:
execstack.c: In function ‘execstack_make_rdwr’:
execstack.c:127:17: error: passing argument 1 of ‘asprintf’ from incompatible pointer type [-Wincompatible-pointer-types]

  127 |       asprintf (&prelink_path, "%s/%s", dirname, PRELINK_PROG EXEEXT);
      |                 ^~~~~~~~~~~~~
      |                 |
      |                 const char **
In file included from execstack.c:10:
/usr/include/stdio.h:403:40: note: expected ‘char ** restrict’ but argument is of type ‘const char **’
  403 | extern int asprintf (char **__restrict __ptr,
      |                      ~~~~~~~~~~~~~~~~~~^~~~~
---
 src/execstack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/execstack.c +1 -1
index fe044c5..4a8b916 100644
@@ -41,7 +41,7 @@ const char *program_path;
 
 /* The full pathname of the prelink tool, or NULL if it hasn't been
    computed yet.  */
-const char *prelink_path;
+char *prelink_path;
 
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
Signature · 1 line
2.34.1
#1 lore raw

Think you could take a look at this?

Quoted 34 lines · James Hilliard

Fixes:
execstack.c: In function ‘execstack_make_rdwr’:
execstack.c:127:17: error: passing argument 1 of ‘asprintf’ from incompatible pointer type [-Wincompatible-pointer-types]

  127 |       asprintf (&prelink_path, "%s/%s", dirname, PRELINK_PROG EXEEXT);
      |                 ^~~~~~~~~~~~~
      |                 |
      |                 const char **
In file included from execstack.c:10:
/usr/include/stdio.h:403:40: note: expected ‘char ** restrict’ but argument is of type ‘const char **’
  403 | extern int asprintf (char **__restrict __ptr,
      |                      ~~~~~~~~~~~~~~~~~~^~~~~
---
 src/execstack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/execstack.c +1 -2
index fe044c5..4a8b916 100644
@@ -41,7 +41,7 @@ const char *program_path;
 
 /* The full pathname of the prelink tool, or NULL if it hasn't been
    computed yet.  */
-const char *prelink_path;
+char *prelink_path;
 
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
--

2.34.1