Skip to content

fix: correct residue_string expected type#178

Open
RubenChM wants to merge 1 commit into
Discngine:masterfrom
RubenChM:master
Open

fix: correct residue_string expected type#178
RubenChM wants to merge 1 commit into
Discngine:masterfrom
RubenChM:master

Conversation

@RubenChM

@RubenChM RubenChM commented Dec 29, 2025

Copy link
Copy Markdown

Changed the declaration of residue_string from an array of pointers (char *[]) to a standard character buffer (char []) and remove the address-of operator (&) when passing the buffer to strcpy, resolving the compiler (GCC 15) error:

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:
/home/conda/feedstock_root/build_artifacts/fpocket_1765458334087/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include/string.h:125:39: note: expected 'char * restrict' but argument is of type 'char * (*)[8000]'
  125 | 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;
      |                       ^

The old implementation was working fine since we are pointing to the same spot in memory, but it was taking 8 times more space for the buffer.

This closes #164 and allows the conda-forge to rebuild without adding constrains to the compiler version.

@simonbray

Copy link
Copy Markdown

@pschmidtke could you have a look and merge? The conda-forge infrastructure is failing to build due to this issue, since it switched to gcc 14. Thanks :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants