ravachol / kew

A command-line music player
GNU General Public License v2.0
567 stars 21 forks source link

error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' #139

Closed yurivict closed 2 months ago

yurivict commented 2 months ago
src/file.c:130:36: warning: call to undeclared function 'get_current_dir_name'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                char *currentDir = get_current_dir_name();
                                   ^
src/file.c:130:23: 
                char *currentDir = get_current_dir_name();
                      ^            ~~~~~~~~~~~~~~~~~~~~~~
src/file.c:144:39: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
                                char *curDir = get_current_dir_name();
                                      ^        ~~~~~~~~~~~~~~~~~~~~~~
src/file.c:190:39: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
                                char *curDir = get_current_dir_name();
                                      ^        ~~~~~~~~~~~~~~~~~~~~~~
1 warning and 3 errors generated.

I believe that getcwd should be used here.

Version: 2.5.1 FreeBSD 14.1

ravachol commented 2 months ago

Thank you, I have reverted back to getcwd() in 2.6.0.