vlang / ved

1 MB text editor written in V with hardware accelerated text rendering. Compiles in <1s.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error: incompatible integer to pointer conversion

bombsimon opened this issue · comments

OS

System Version: macOS 10.15.1 (19B88)
Kernel Version: Darwin 19.0.0

V

$ v --version
V 0.1.24 25e7cee

vid

$ git rev-parse --verify HEAD
f8cb1f3715cf96c0eca834b6273baf26d2a07468

Build

$ v .
/private/var/folders/q3/bf76j42160j2nt4s2tz1_fd40000gn/T/v/vid.tmp.c:4216:7: warning: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversio...
(Use `v -g` to print the entire error message)

V error: C error. This should never happen.
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose
Full error message
C compiler=cc
/Users/x/git/v/vlib/gl/gl.v:15:7: warning: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion]
void* ok= gladLoadGL ( ) ;
      ^   ~~~~~~~~~~~~~~
/Users/x/git/v/vlib/gl/gl.v:43:34: warning: incompatible pointer types passing 'byte **' (aka 'unsigned char **') to parameter of type 'const GLchar *const *' (aka 'const char *const *') [-Wincompatible-pointer-types]
 glShaderSource ( shader ,  a ,  & source .str ,  b ) ;
                                 ^~~~~~~~~~~~~
/Users/x/git/v/vlib/gl/gl.v:43:51: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const GLint *' (aka 'const int *'); take the address with & [-Wint-conversion]
 glShaderSource ( shader ,  a ,  & source .str ,  b ) ;
                                                  ^
                                                  &
/Users/x/git/v/vlib/gl/gl.v:77:45: warning: passing 'byte [512]' to parameter of type 'GLchar *' (aka 'char *') converts between pointers to integer types with different sign [-Wpointer-sign]
 glGetShaderInfoLog ( shader ,  512 ,  0 ,  info_log ) ;
                                            ^~~~~~~~
/Users/x/git/v/vlib/gl/gl.v:83:48: warning: passing 'byte [1024]' to parameter of type 'GLchar *' (aka 'char *') converts between pointers to integer types with different sign [-Wpointer-sign]
 glGetProgramInfoLog ( program ,  1024 ,  0 ,  info_log ) ;
                                               ^~~~~~~~
/Users/x/git/v/vlib/gl/gl.v:147:43: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
 glDrawElements ( mode ,  count ,  typ ,  indices ) ;
                                          ^~~~~~~
/Users/x/git/v/vlib/gl/gl.v:177:74: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
 glVertexAttribPointer ( index ,  size ,  typ ,  normalized ,  stride ,  ptr ) ;
                                                                         ^~~
/Users/x/git/v/vlib/stbi/stbi.v:52:39: warning: passing 'char *' to parameter of type 'const stbi_uc *' (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
 res .data  =  stbi_load_from_memory ((char*) buf ,  3812 ,  & res .width ,  & res .height ,  & res .nr_channels ,  flag ) ;
                                      ^~~~~~~~~~~
/Users/x/git/v/thirdparty/stb_image/stb_image.h:1287:55: note: passing argument to parameter 'buffer' here
STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
                                                      ^
/Users/x/git/v/vlib/uiold/ui_darwin.v:28:2: warning: incompatible function pointer types passing 'void (*)(void *, void *, void *)' to parameter of type 'EventHandlerUPP' (aka 'int (*)(struct OpaqueEventHandlerCallRef *, struct OpaqueEventRef *, void *)') [-Wincompatible-function-pointer-types]
 InstallApplicationEventHandler(&uiold__focus_app, 1, &eventType, NULL, NULL);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEvents.h:15098:57: note: expanded from macro 'InstallApplicationEventHandler'
      InstallEventHandler( GetApplicationEventTarget(), (handler), (numTypes), (list), (userData), (outHandlerRef) )
                                                        ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEventsCore.h:2594:26: note: passing argument to parameter 'inHandler' here
  EventHandlerUPP        inHandler,
                         ^
/Users/x/git/v/vlib/glfw/glfw.v:247:23: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'GLFWcursor *' (aka 'struct GLFWcursor *') [-Wint-conversion]
 glfwSetCursor ( 0 ,  GLFW_IBEAM_CURSOR ) ;
                      ^~~~~~~~~~~~~~~~~
/Users/x/git/v/thirdparty/glfw/GLFW/glfw3.h:1051:37: note: expanded from macro 'GLFW_IBEAM_CURSOR'
#define GLFW_IBEAM_CURSOR           0x00036002
                                    ^~~~~~~~~~
/Users/x/git/v/thirdparty/glfw/GLFW/glfw3.h:4329:60: note: passing argument to parameter 'cursor' here
GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
                                                           ^
/Users/x/git/v/vlib/glfw/glfw.v:252:30: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'GLFWcursor *' (aka 'struct GLFWcursor *') [-Wint-conversion]
 glfwSetCursor ( w ->data ,  GLFW_IBEAM_CURSOR ) ;
                             ^~~~~~~~~~~~~~~~~
/Users/x/git/v/thirdparty/glfw/GLFW/glfw3.h:1051:37: note: expanded from macro 'GLFW_IBEAM_CURSOR'
#define GLFW_IBEAM_CURSOR           0x00036002
                                    ^~~~~~~~~~
/Users/x/git/v/thirdparty/glfw/GLFW/glfw3.h:4329:60: note: passing argument to parameter 'cursor' here
GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
                                                           ^
/Users/x/git/v/vlib/glfw/glfw.v:272:14: warning: initializing 'GLFWvidmode *' (aka 'struct GLFWvidmode *') with an expression of type 'const GLFWvidmode *' (aka 'const struct GLFWvidmode *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
GLFWvidmode* mode= glfwGetVideoMode ( glfwGetPrimaryMonitor ( ) ) ;
             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/x/git/v/vlib/glm/glm.v:254:31: warning: incompatible integer to pointer conversion assigning to 'f32 *' (aka 'float *') from 'int' [-Wint-conversion]
 res [/*ptr!*/ 0 ]/*rf32 1*/  =  1 ;
                              ^  ~
/Users/x/git/v/vlib/glm/glm.v:255:31: warning: incompatible integer to pointer conversion assigning to 'f32 *' (aka 'float *') from 'int' [-Wint-conversion]
 res [/*ptr!*/ 5 ]/*rf32 1*/  =  1 ;
                              ^  ~
/Users/x/git/v/vlib/glm/glm.v:256:32: warning: incompatible integer to pointer conversion assigning to 'f32 *' (aka 'float *') from 'int' [-Wint-conversion]
 res [/*ptr!*/ 10 ]/*rf32 1*/  =  1 ;
                               ^  ~
/Users/x/git/v/vlib/glm/glm.v:261:32: warning: incompatible integer to pointer conversion assigning to 'f32 *' (aka 'float *') from 'int' [-Wint-conversion]
 res [/*ptr!*/ 15 ]/*rf32 1*/  =  1 ;
                               ^  ~
/Users/x/git/v/vlib/freetype/freetype.v:116:23: warning: passing 'int *' to parameter of type 'GLuint *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign]
 glGenTextures ( 1 ,  & texture ) ;
                      ^~~~~~~~~
/Users/x/git/v/vlib/freetype/freetype.v:168:7: warning: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'FT_Error' (aka 'int') [-Wint-conversion]
void* ret= FT_Init_FreeType ( & ft ) ;
      ^    ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/x/git/v/vlib/freetype/freetype.v:188:7: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
 ret  =  ((int)( FT_New_Face ( ft , (char*) font_path .str ,  0 ,  & face ) ) ) ;
      ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 warnings generated.
ld: warning: directory not found for option '-L/opt/local/lib'
ld: library not found for -lglfw
clang: error: linker command failed with exit code 1 (use -v to see invocation)
V error: C error. This should never happen. 
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose

My bad, this isn't related to vid so I'll add this issue in v instead.

EDIT: Actually, I won't. I installed glfw instead (brew install glfw) which solved this issue.