Jump to content

untested compiler warnings


king2

Recommended Posts

According to "You are using an un-tested compiler. Please report any compile errors or warnings on the ugfx forum" I reporting warnings here (IAR):

(orientation_t and powermode_t):

Warning[Pe767]: conversion from pointer to smaller integer gdisp_lld_STM32LTDC.c 318

Warning[Pe767]: conversion from pointer to smaller integer gdisp_lld_STM32LTDC.c 320

Warning[Pe767]: conversion from pointer to smaller integer gdisp_lld_STM32LTDC.c 327

Warning[Pe767]: conversion from pointer to smaller integer gdisp_lld_STM32LTDC.c 331

Warning[Pe767]: conversion from pointer to smaller integer gdisp_lld_STM32LTDC.c 333

Warning[Pe767]: conversion from pointer to smaller integer gdisp_lld_STM32LTDC.c 357

also:

Warning[Pa093]: implicit conversion from floating point to integer gdisp.c 1728

Warning[Pa093]: implicit conversion from floating point to integer gdisp.c 1729

Warning[Pa093]: implicit conversion from floating point to integer gdisp.c 1855

Warning[Pa093]: implicit conversion from floating point to integer gdisp.c 1856

Warning[Pe767]: conversion from pointer to smaller integer gdisp.c 2676

Warning[Pe188]: enumerated type mixed with another type gdisp.c 3308

Warning[Pe188]: enumerated type mixed with another type gdisp.c 3368

and last:

Warning[Pe1105]: #warning directive: "GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters." gdisp_rules.h 65

I'm using STM32 LTDC driver, that uses part of SDRAM as videobuffer, so reading pixels is possible.

Link to comment
Share on other sites

Thank you for that. We will go through those warnings and try to resolve them.

I will also investigate why you are getting that warning to do with the anti-alias support. It might (or might not) be related to the compiler. Either way we will sort it out in the next few days and then add that compiler to the supported list.

In the mean time your code should still work

Link to comment
Share on other sites

  • 4 weeks later...

Regarding the warnings of the STM32_LTDC driver... is it possible that you are not using the latest code? The line numbers in your warnings don't match the ones in the actual driver source-code.

We have marked the compiler as tested for now as you reported to us that it's working fine besides those warnings. We will try to figure out the correct pragmas to get rid of these.

Link to comment
Share on other sites

I'm using now fresh driver and get same warning.

What about GDISP_NEED_PIXELREAD, I just have no idea where I should use it.

From one point of view, it is property of display driver, so it should be set in driver's header file.

I have tried this but at moment compiler get into my board_STM32LTDC.h, GDISP_NEED_PIXELREAD already set by gfx_options.h and I get 'incompatible redefinition' warning.

From other side, in examples it used in gfxconf.h, so I just added it to my prepare script, as I cannot add it directly from Studio.

This works for me and warning about GDISP_NEED_PIXELREAD was disappeared.

Link to comment
Share on other sites

I have tested this, it is not working. It recognizes as compiler #22, i.e. EDG, I have no idea why. I moved its detection to position upper than EDG, and it started to be #29, i.e. IAR. I suggest to make this change in uGFX repo.

Then I compiled entire project, warnings I got follows:

gdisp_lld_STM32LTDC.c  
Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\drivers\gdisp\STM32LTDC\gdisp_lld_STM32LTDC.c 1 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdriver\gdriver.h 90 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdisp\gdisp_driver.h 731 

gfx_mk.c  
Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\src\gfx_mk.c 1 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 
Warning[Pe1105]: #warning directive: "GOS: Operating System initialization has been turned off. Make sure you call halInit() and chSysInit() before gfxInit() in your application!" \ugfx\src\gos\gos_chibios.c 52 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdriver\gdriver.h 90 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdisp\gdisp.c 585 
Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1728 
Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1729 
Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1855 
Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1856 
Warning[Pe188]: enumerated type mixed with another type \ugfx\src\gdisp\gdisp.c 3308 
Warning[Pe188]: enumerated type mixed with another type \ugfx\src\gdisp\gdisp.c 3368 
Warning[Pe111]: statement is unreachable \ugfx\src\gtimer\gtimer.c 112 
Warning[Pe111]: statement is unreachable \ugfx\src\gwin\gwin.c 330 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 91 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 110 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 121 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 122 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 122 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 123 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 124 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 127 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 128 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 134 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 169 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 235 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 235 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 294 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 327 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 474 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 499 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 545 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 549 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 549 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 612 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 613 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 650 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 672 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 677 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 697 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 703 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 703 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 762 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 798 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gfile\gfile.c 37 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gfile\gfile_fs_rom.c 37 

gmouse_lld_FT5x06.c  
Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\drivers\ginput\touch\FT5x06\gmouse_lld_FT5x06.c 1 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 
Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdriver\gdriver.h 90 
Warning[Pe083]: type qualifier specified more than once \ugfx\drivers\ginput\touch\FT5x06\gmouse_lld_FT5x06.c 102 

gui.c  
Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\gfx.h 1 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 
Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 

 

Edited by king2
Link to comment
Share on other sites

The reason you are getting the warnings about pixel reading requirements for anti-alised fonts is that you haven't turned on the pixel reading function. Whilst your hardware supports pixel reading it still needs to be turned on in your configuration file.

This is done by defining GDISP_NEED_PIXELREAD as TRUE in your gfxconf.h file - NOT in the driver board file (it is too late by then).

 

 

Link to comment
Share on other sites

Just to keep things in one place.. I just tested 2.5.

1. It recognizes IAR as compiler #22, i.e. EDG, I have no idea why. I moved its detection to position upper than EDG, and it started to be #29, i.e. IAR.

2. Many non-native line ending warnings, in uGFX files and Studio generated files. I think it will be better to keep line endings or UNIX-like, or CRLF, but one standard for all files.

3. Also I have two warnings 'Warning[Pe301]: typedef name has already been declared (with same type)', it raises when compiling each file that uses header with structs:

typedef struct point {
	coord_t x;		/**< The x coordinate of the point. */
	coord_t y;		/**< The y coordinate of the point. */
} point, point_t;

typedef struct GWindowObject {
	#if GWIN_NEED_WINDOWMANAGER
		// This MUST be the first member of the structure
		gfxQueueASyncItem	wmq;				/**< The next window (for the window manager) */
	#endif
	const struct gwinVMT*	vmt;				/**< The VMT for this GWIN */
	GDisplay *				display;			/**< The display this window is on */
	coord_t					x;					/**< The position relative to the screen */
	coord_t					y;					/**< The position relative to the screen */
	coord_t					width;				/**< The width of this window */
	coord_t					height;				/**< The height of this window */
	color_t					color;				/**< The current foreground drawing color */
	color_t					bgcolor;			/**< The current background drawing color */
	uint32_t				flags;				/**< Window flags (the meaning is private to the GWIN class) */
	#if GDISP_NEED_TEXT
		font_t				font;				/**< The current font */
	#endif
	#if GWIN_NEED_CONTAINERS
		GHandle				parent;				/**< The parent window */
	#endif
} GWindowObject, * GHandle;

I have no idea how to eliminate those warnings, I know C not so much, but its a most boring and repeating warnings :(

4. Warnings 'Warning[Pe083]: type qualifier specified more than once' about definitions like this: 

typedef const struct GDriverVMT const GDriverVMTList[1];

May be there is a reason to use const qualifier twice in same definition?

Link to comment
Share on other sites

1. We will look at changing the order of those lines to get better detection.

2. The line-endings often change as it is moved in and out of git. We use both windows and unix for code development, and then git sometimes plays with the line endings as well. Have a look at how your git program is handling EOL's as that could be where the problem is. Other than that, when we get a copy of the IAR compiler we will spend some effort in removing some of these warnings - probably just by turning them off with #pragma's.

3. This is because we are defining structs as "typedef struct x {} x". Note that this is perfectly valid C, is used everywhere in all sorts of code (not just ours), and really should not be a warning at all when defined on the same structure.

4. This again is a compiler error because it is complaining about perfectly valid C that has real sementic meaning. Many common modern compilers make this mistake (including GCC). The semantic meaning behind the double const (take note where the const are actually applied) is:  the structure GDriverVMT should be put into const (program/code) segment, AND the array definition should ALSO be put into const (program/code) segment. Modern compilers assume that they should both be const when it sees the first const statement and therefore complains when it sees the 2nd const. Note some older DSP micro's and some older super computers require different assumptions as arrays of objects are not necessarily directly addressable as the address of the first element - they must be addressed indirectly as the hardware requires this for management of the pipelining of the array operations. In that situation there are real differences between having just the first const versus having both const's. So, modern compilers often semantically treat this incorrectly and complain about the 2nd const when in fact they shouldn't as it is perfectly valid C with real meaning on some processors.

 

Link to comment
Share on other sites

Thanks for answer!

2. You can get kickstarter edition IAR for free with 32k code size limitation, I think it can be enough for just a warnings testing. If not, it will still compile, and just not link, so you will see all warnings anyway :)

What about line endings, please tell me where you are preparing uGFX files for distribution (i.e. archives for downloading and folder to be placed in Studio distribution), and I will write simple script for you, that will scan all files in folder and convert them into one type. Just tell me iа you want me to do this, which type do you want to be basic for all files and which OSs are you using in prepare process.

3 and 4. OK, I got it. So, if it was made this way for a reason, definitely it should be left as is, but it will be nice to make IAR not complaining about this. Maybe pragmas will help.

If not, maybe it will be nice to document this behavior and make recommendations to users about which warning they can safely turn off in IAR (but this is worst case, because warning can be turned off only for entire project, this can produce false-negatives in source files not belonging to uGFX).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...