Skip to content

error: assignment to ‘char *’ from incompatible pointer type ‘char ** #164

Description

@yaideltg

Describe the bug
Just cloned the repo and typed 'make'. I got the following error.

gcc -W -Wextra -Wwrite-strings -Wstrict-prototypes -DM_OS_LINUX -DMNO_MEM_DEBUG -O2 -g -pg -std=gnu99 -Iplugins/include -Iplugins/LINUXAMD64/molfile -c src/fparams.c -o obj/fparams.o
src/fparams.c: In function ‘get_fpocket_args’:
src/fparams.c:296:24: error: passing argument 1 of ‘strcpy’ from incompatible pointer type [-Wincompatible-pointer-types]
296 | strcpy(&residue_string, pt);
| ^~~~~~~~~~~~~~~
| |
| char * ()[8000]
In file included from src/../headers/fparams.h:19,
from src/fparams.c:2:
/usr/include/string.h:141:39: note: expected ‘char * restrict’ but argument is of type ‘char * (
)[8000]’
141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
| ~~~~~~~~~~~~~~~~~^~~~~~
src/fparams.c:297:23: error: assignment to ‘char *’ from incompatible pointer type ‘char **’ [-Wincompatible-pointer-types]
297 | rest2 = residue_string;

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo
  2. Hit 'make' in the console.
  3. Wait till the error appears

Expected behavior
It's expected for the make to complete successfully.

Desktop (please complete the following information):

  • OS: Fedora Linux 41 (Workstation Edition)

Additional context

I have included in line 284 the following declaration for residue_string, and it worked, at least for the compilation. I'm not sure which effect this can have for the results and expected behaviour of the code.

281 strcpy(par->custom_pocket_arg, optarg);
282 char *rest = par->custom_pocket_arg;
283 char *rest2;
284+ char residue_string[8000];
...
296- strcpy(&residue_string, pt);
296+ strcpy(residue_string, pt);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions