Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgen error incompatible pointer type #23482

Open
quaesitor-scientiam opened this issue Jan 16, 2025 · 4 comments
Open

cgen error incompatible pointer type #23482

quaesitor-scientiam opened this issue Jan 16, 2025 · 4 comments

Comments

@quaesitor-scientiam
Copy link

quaesitor-scientiam commented Jan 16, 2025

V version: V 0.4.9 8c1d08a, press to see full `v doctor` output
V full version V 0.4.9 45fd7eb.8c1d08a
OS windows, Microsoft Windows 11 Pro 26100 64-bit
Processor 24 cpus, 64bit, little endian, AMD Ryzen 9 5900X 12-Core Processor
Memory 99.93GB/127.92GB
V executable S:\repo\vlang\v.exe
V last modified time 2025-01-16 01:36:39
V home dir OK, value: S:\repo\vlang
VMODULES OK, value: C:\Users\john3.vmodules
VTMP OK, value: C:\Users\john3\AppData\Local\Temp\v_0
Current working dir OK, value: S:\vSelenium
Git version git version 2.45.1.windows.1
V git status weekly.2025.1-88-g8c1d08a7
.git/config present true
cc version N/A
gcc version gcc (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r2) 14.2.0
clang version (built by Brecht Sanders, r2) clang version 19.1.1
msvc version N/A
tcc version tcc version 0.9.27 (x86_64 Windows)
tcc git status thirdparty-windows-amd64 b425ac82
emcc version N/A
glibc version N/A

What did you do?
./v -g -o vdbg cmd/v && ./vdbg -cg main.v && S:\vSelenium\main.exe

module main

import webdriver.edge {EdgeDriver, EdgeOptions}


fn open_browser(download_path string) ?EdgeDriver {
	mut options := EdgeOptions.init()
	options.add_experimental_option('excludeSwitches', ['enable-logging'])
	options.add_experimental_option('detach', true)
	options.add_experimental_option('prefs', {'download.default_directory': download_path})

	mut driver := EdgeDriver.init(options, none)

	return driver
}

fn main() {
	driver := open_browser("S:/Business Projects/PartsUnlimited/downloads")
	if driver == none {
		println('No Driver was created')
	} else {
		println("Successful driver creation")
	}
}

What did you see?

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:796: warning: WINVER redefined

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:1198: warning: InterlockedIncrement64 redefined

In file included from C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:1563:

s:/repo/vlang/thirdparty/tcc/include/winapi/synchapi.h:13: warning: CreateEvent redefined

In file included from C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:1563:

s:/repo/vlang/thirdparty/tcc/include/winapi/synchapi.h:117: warning: OpenEvent redefined

In file included from C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:1563:

s:/repo/vlang/thirdparty/tcc/include/winapi/synchapi.h:167: warning: CreateMutex redefined

In file included from C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:1730:

S:/repo/vlang/thirdparty/vschannel/vschannel.c:284: warning: implicit declaration of function 'WSAConnectByNameW'

In file included from C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:1730:

S:/repo/vlang/thirdparty/vschannel/vschannel.c:300: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:10742: warning: implicit declaration of function 'tcc_backtrace'

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:16691: warning: implicit declaration of function 'GetFinalPathNameByHandleW'

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:17884: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:17897: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:17914: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:17921: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:17959: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:17969: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:18042: warning: implicit declaration of function 'inet_ntop'

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:18042: warning: cast between pointer and integer of different size

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:18052: warning: cast between pointer and integer of different size

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:18775: warning: assignment from incompatible pointer type

C:/Users/john3/AppData/Local/Temp/v_0/main.01JHPCCYDN49R1YT7BN7PQBMMV.tmp.c:22406: error: expected struct or union but not 'struct _option_webdriver__edge__EdgeService *'
builder error: 
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

What did you expect to see?

Clean compile

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Copy link

Connected to Huly®: V_0.6-21912

@quaesitor-scientiam
Copy link
Author

quaesitor-scientiam commented Jan 16, 2025

module edge

import webdriver.chromium {ChromiumDriver}
import webdriver.common {Edge}

pub struct EdgeDriver {
	ChromiumDriver
}
pub fn EdgeDriver.init(options ?EdgeOptions, service ?EdgeService) ?EdgeDriver {
	mut svc  := service
	mut opts := options
	if svc == none { svc = EdgeService.init(none, 0, none, none, none, none) }
	if opts == none { opts = EdgeOptions.init() }
	if opts != none {
		if svc != none {
			bname := Edge{}.browser_name
			drv := ChromiumDriver.init(bname, 'ms', opts, svc, true)
			return EdgeDriver{ChromiumDriver: drv}
		}
	}

	return none
}

@quaesitor-scientiam
Copy link
Author

module chromium

import webdriver.remote {RemoteWebDriver}
import webdriver.common {ArgOptions, Service}


// ChromiumDriver - Create a new WebDriver instance of the ChromiumDriver. Starts the
//        service and then creates new WebDriver instance of ChromiumDriver.
//
//    Args:
//         - browser_name - Browser name used when matching capabilities.
//         - vendor_prefix - Company prefix to apply to vendor-specific WebDriver extension commands.
//         - options - this takes an instance of ChromiumOptions
//         - service - Service object for handling the browser driver if you need to pass extra details
//         - keep_alive - Whether to configure ChromiumRemoteConnection to use HTTP keep-alive.
pub struct ChromiumDriver {
		RemoteWebDriver
		browser_name  ?string
		vendor_prefix ?string
		options       ArgOptions
		service 	  ?Service
		keep_alive    bool = true
}
pub fn ChromiumDriver.init[T,S](browser_name string, vendor_prefix string, options T, service S, keep_alive bool) ChromiumDriver {

	return ChromiumDriver{}
}

@quaesitor-scientiam
Copy link
Author

Full code at vSelenium

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

No branches or pull requests

1 participant