Coder Social home page Coder Social logo

Comments (15)

mibcat avatar mibcat commented on August 25, 2024 1

No - no warnings anymore (for both c and cpp) 👍

from lv_drivers.

embeddedt avatar embeddedt commented on August 25, 2024

Compiling the master branch shows a lot of new warnings, mainly

I compile LittlevGL with many warnings enabled and I only get warnings from one file. What warnings are you using?

the cpp keyword "template" is used as function argument

Fixed here: 627b3d1

The lv_drv_conf_templ.h has 3 devices enabled per default

I'm not entirely sure why these are enabled out-of-the-box. The folder structure they're assuming appears to predate 6.0 so I'm guessing these haven't been updated in a while.

from lv_drivers.

mibcat avatar mibcat commented on August 25, 2024

Thanks for your feedback.

regarding the warnings:
I'm using this setting (and doesn't change it for v6 or v7)

# set compiler settings
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O3")

seems to be a cpp related issue (extern "C") in the lv_drv_conf.h header:
e.g. each function definition with arguments leads to an unused parameter warning.
Selection_033

regarding the default enabled devices:
This is strange indeed - I had no compile issues with the release/v6 branch.
Should be examined more closely ...

from lv_drivers.

kisvegabor avatar kisvegabor commented on August 25, 2024

Sorry, it's my fault. During merging branches I messed up something.

I reverted it, and now should work.

from lv_drivers.

mibcat avatar mibcat commented on August 25, 2024

Ok - jumping back will eliminate those issues ;-)

but I still get one warning type (warning: missing initializer for member) from lv_color.h like

/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h: In function ‘void lv_color_mix_with_alpha(lv_color_t, lv_opa_
t, lv_color_t, lv_opa_t, lv_color_t*, lv_opa_t*)’:
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:536:47: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::green’ [-Wmissing-field-initializers]
         static lv_color_t fg_color_save = {{0}};
                                               ^

I'm not sure but I think those warnings were emitted also in the past ...

from lv_drivers.

kisvegabor avatar kisvegabor commented on August 25, 2024

Ok - jumping back will eliminate those issues ;-)

Great!

but I still get one warning type (warning: missing initializer for member) from lv_color.h like

That's strange why it complains only about green as red and blue are just next to it. With GCC I don't get a warning for this.

from lv_drivers.

mibcat avatar mibcat commented on August 25, 2024

sorry my last comment may be misleading:
it's only one type of warning - of course there also warnings for the other colors red and blue

I'm using gcc with the additional compiler settings -Wall -Wextra

pi@raspi3b:~ $
> gcc --version
gcc (Raspbian 8.3.0-6+rpi1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

from lv_drivers.

mibcat avatar mibcat commented on August 25, 2024

yep: -Wextra contains -Wmissing-field-initializers

from lv_drivers.

kisvegabor avatar kisvegabor commented on August 25, 2024

Test run with these settings and it doesn't show warnings.

Could you send the whole build log and your lv_conf.h?

from lv_drivers.

mibcat avatar mibcat commented on August 25, 2024

You are right !
The warnings only occurs due my attempt to use lvgl in my class gui.cpp and are thrown if this module is including lvgl headers, e.g.

[ 89%] Building CXX object CMakeFiles/rfm96_test.dir/gui.cpp.o                                                                                    
In file included from /home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/lv_hal_disp.h:21,                                             
                 from /home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/lv_hal.h:16,
                 from /home/pi/work/lora/Rfm96Raspberry/Application/lvgl/lvgl.h:22,
                 from /home/pi/work/lora/Rfm96Raspberry/Application/lv_drivers/display/fbdev.h:29,
                 from /home/pi/work/lora/Rfm96Raspberry/Application/gui.h:12,
                 from /home/pi/work/lora/Rfm96Raspberry/Application/gui.cpp:8:
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h: In function ‘void lv_color_mix_with_alpha(lv_color_t, lv_opa_
t, lv_color_t, lv_opa_t, lv_color_t*, lv_opa_t*)’:
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:536:47: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::green’ [-Wmissing-field-initializers]
         static lv_color_t fg_color_save = {{0}};
                                               ^
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:536:47: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::red’ [-Wmissing-field-initializers]
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:537:47: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::green’ [-Wmissing-field-initializers]
         static lv_color_t bg_color_save = {{0}};
                                               ^
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:537:47: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::red’ [-Wmissing-field-initializers]
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:538:49: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::green’ [-Wmissing-field-initializers]
         static lv_color_t res_color_saved = {{0}};
                                                 ^
/home/pi/work/lora/Rfm96Raspberry/Application/lvgl/src/lv_hal/../lv_misc/lv_color.h:538:49: warning: missing initializer for member ‘lv_color16_t:
:<unnamed struct>::red’ [-Wmissing-field-initializers]

But in the end, due to the static c implementation of lvgl, I had to make so many "exceptions" in the class that it really doesn't make sense to force a cpp class for this.

Reverting back the code to c removes all warnings - so we can close this issue.

Thanks for your support !!

from lv_drivers.

embeddedt avatar embeddedt commented on August 25, 2024

We should still fix it, as C++ code should be able to include public headers without warnings.

from lv_drivers.

mibcat avatar mibcat commented on August 25, 2024

OK, fine !

Adding the missing parts (in my case green and blue because of LV_COLOR_DEPTH = 16) will eliminate the warning

e.g. replacing line 536:
static lv_color_t fg_color_save = {{0}};
by this one:
static lv_color_t fg_color_save = { { 0, 0, 0 } };

But due to the different implementation possibilities (dependency on LV_COLOR_DEPTH and others) a new init macro should be created ...

from lv_drivers.

kisvegabor avatar kisvegabor commented on August 25, 2024

I fixed it like this: 966b4b11

Do you still see the warning?

from lv_drivers.

embeddedt avatar embeddedt commented on August 25, 2024

Great! I guess we can close this issue then.

from lv_drivers.

kisvegabor avatar kisvegabor commented on August 25, 2024

Great! :)

from lv_drivers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.