Skip to content

Conversation

@Ansuel
Copy link

@Ansuel Ansuel commented Nov 22, 2025

This fix compilation error with implicit declaration of function canonicalize_file_name:

transform.c: In function 'transform_save':
transform.c:1192:21: error: implicit declaration of function 'canonicalize_file_name' [-Wimplicit-function-declaration]
1192 | augorig_canon = canonicalize_file_name(augorig);
| ^~~~~~~~~~~~~~~~~~~~~~
transform.c:1192:21: warning: nested extern declaration of 'canonicalize_file_name' [-Wnested-externs]
transform.c:1192:19: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1192 | augorig_canon = canonicalize_file_name(augorig);
| ^
transform.c: In function 'remove_file':
transform.c:1476:19: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1476 | augorig_canon = canonicalize_file_name(augorig);
| ^

canonicalize_file_name is a GNU extension, to address the error and not having to declare GNU extention support, use the more portable version real_path that does directly replace canonicalize_file_name.

This fix compilation error with implicit declaration of function
canonicalize_file_name:

transform.c: In function 'transform_save':
transform.c:1192:21: error: implicit declaration of function 'canonicalize_file_name' [-Wimplicit-function-declaration]
 1192 |     augorig_canon = canonicalize_file_name(augorig);
      |                     ^~~~~~~~~~~~~~~~~~~~~~
transform.c:1192:21: warning: nested extern declaration of 'canonicalize_file_name' [-Wnested-externs]
transform.c:1192:19: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1192 |     augorig_canon = canonicalize_file_name(augorig);
      |                   ^
transform.c: In function 'remove_file':
transform.c:1476:19: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1476 |     augorig_canon = canonicalize_file_name(augorig);
      |                   ^

canonicalize_file_name is a GNU extension, to address the error and not
having to declare GNU extention support, use the more portable version
real_path that does directly replace canonicalize_file_name.

Signed-off-by: Christian Marangi <[email protected]>
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.

1 participant