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

Compiler warnings and errors #80

Closed
mrwert opened this issue Apr 13, 2017 · 9 comments
Closed

Compiler warnings and errors #80

mrwert opened this issue Apr 13, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@mrwert
Copy link

mrwert commented Apr 13, 2017

Hello!

src/platform/windows/windows_display.c
[398]: wsprintf( str, L"LCUI_CreateWinAppDriver(): error code: %d\n", GetLastError() );
Warning C4133: 'function' : incompatible types - from 'wchar_t *' to 'LPCSTR'.

src/platform/windows/windows_events.c
[172]: wsprintf( str, L"LCUI_CreateWinAppDriver(): error code: %d\n", GetLastError() );
Warning C4133: 'function' : incompatible types - from 'wchar_t [256]' to 'LPSTR'.
and
Warning C4133: 'function' : incompatible types - from 'unsigned short [43]' to 'LPCSTR'.

src/platform/windows/windows_events.c
[173]: MessageBox( NULL, str, szAppName, MB_ICONERROR );
Warning C4133: 'function' : incompatible types - from 'wchar_t [256]' to 'LPCSTR'.

src/platform/windows/windows_events.c
[177]: app->PostTask = WIN_PostTask;
Error C2039: ‘PostTask’ is not a member of ‘LCUI_AppDriverRec_’.

src/platform/windows/windows_events.c
[178]: app->WaitEvent = WIN_WaitEvent;
Error C2039: ‘WaitEvent’ is not a member of ‘LCUI_AppDriverRec_’.

LCUI version: [2.661 commits / 13.04.2017]
OS and version: [Windows 7]
Build tools: [vcvars32.bat -> cl.exe (VisualStudio 2015)]

Thanks!

@mrwert
Copy link
Author

mrwert commented Apr 13, 2017

src/display.c: In function ‘OnSurfaceEvent’:
src/display.c:556:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
e_type = ((int)&arg);
^~~~~~

LCUI version: [2.661 commits / 13.04.2017]
OS and version: [Linux Ubuntu 4.10.0-19-generic]
Build tools: [gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)]

@mrwert
Copy link
Author

mrwert commented Apr 13, 2017

src/image/jpeg.c: In function ‘LCUI_ReadJPEGHeader’:
src/image/jpeg.c:171:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
mark = ((short int)jpeg_reader->buffer);
^~~~

LCUI version: [2.661 commits / 13.04.2017]
OS and version: [Linux Ubuntu 4.10.0-19-generic]
Build tools: [gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)]

@lc-soft lc-soft changed the title Warnings and errors. Compiler warnings and errors Apr 14, 2017
@lc-soft lc-soft self-assigned this Apr 14, 2017
@lc-soft lc-soft added this to the 1.0.0 alpha 1 milestone Apr 14, 2017
@lc-soft
Copy link
Owner

lc-soft commented Apr 14, 2017

Warning C4133: 'function' : incompatible types - from 'wchar_t [256]' to 'LPSTR'.

The correct content should be: from 'wchar_t [256]' to 'LPWSTR'. But it seems _UNICODE macro does not work. I will try to solve this problem tomorrow.

@lc-soft
Copy link
Owner

lc-soft commented Apr 15, 2017

Ok, now you can try rebuild in windows agian.

@mrwert
Copy link
Author

mrwert commented Apr 16, 2017

Ok.

src/platform/windows/windows_events.c
[164]: wndclass.lpszClassName = szAppName;
Warning C4133: '=' : incompatible types - from 'wchar_t *' to 'LPCSTR'.

src/font/charset.c
[136]: }
Warning C4715: 'LCUI_DecodeString' : not all control paths return a value.

Thanks!

@mrwert
Copy link
Author

mrwert commented Apr 16, 2017

hm...
[display] init ...
[display] init failed
[timer] timer thread is working
and the end...

@lc-soft
Copy link
Owner

lc-soft commented Apr 16, 2017

@mrwert You can switch to v140_xp toolset.

image

Universal Windows Platform (UWP) version of the driver support code is not included in the LCUI source code.

@lc-soft lc-soft closed this as completed Apr 16, 2017
@mrwert
Copy link
Author

mrwert commented Apr 17, 2017

src/platform/windows/windows_events.c
[170]: if( !RegisterClass( &wndclass ) ) {
Warning C4133: 'function' : incompatible types - from 'WNDCLASSW *' to 'const WNDCLASSA *'.

LCUI version: [2.671 commits / 17.04.2017]
OS and version: [Windows 10]
Build tools: [vcvars32.bat -> cl.exe (VisualStudio 2017)]

@lc-soft
Copy link
Owner

lc-soft commented Apr 18, 2017

@mrwert It seems that the _UNICODE macro does not work in your compiler,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants