Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Many notices and warnings with compiling YottaDB 1.32 from sources

104 views
Skip to first unread message

Сергей Каменев

unread,
Oct 2, 2021, 10:52:26 AM10/2/21
to
Hi!
Is that how it should be? Is this normal or am I doing something wrong?
gcc 10.3.0

...
[ 89%] Building C object CMakeFiles/libyottadb.dir/sr_unix/ftok_main.c.o
[ 89%] Linking C shared module libyottadb.so
/tmp/tmp/YDB/sr_port/gdsfhead.h:1101:21: warning: type of ‘pin_fail_bt’ does not match original declaration [-Wlto-type-mismatch]
1101 | GBLREF bt_rec_ptr_t pin_fail_bt; /* Pointer to bt of the cache-record that we failed to pin */
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:891:21: note: ‘pin_fail_bt’ was previously declared here
891 | GBLDEF bt_rec_ptr_t pin_fail_bt; /* Pointer to bt of the cache-record that we failed to pin */
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:891:21: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/tmp/tmp/YDB/sr_port/gdsfhead.h:1102:16: warning: type of ‘pin_fail_bt_contents’ does not match original declaration [-Wlto-type-mismatch]
1102 | GBLREF bt_rec pin_fail_bt_contents; /* Contents of bt of the cache-record that we failed to pin */
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:892:16: note: ‘pin_fail_bt_contents’ was previously declared here
892 | GBLDEF bt_rec pin_fail_bt_contents; /* Contents of bt of the cache-record that we failed to pin */
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:892:16: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/tmp/tmp/YDB/sr_port/dm_setup.c:20:18: warning: type of ‘gtm_err_dev’ does not match original declaration [-Wlto-type-mismatch]
20 | GBLREF io_desc *gtm_err_dev;
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:412:19: note: ‘gtm_err_dev’ was previously declared here
412 | GBLDEF io_desc *gtm_err_dev;
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:412:19: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/tmp/tmp/YDB/sr_port/m_zwrite.c:47:25: warning: type of ‘svn_data’ does not match original declaration [-Wlto-type-mismatch]
47 | LITREF svn_data_type svn_data[];
| ^
/tmp/tmp/YDB/sr_port/expritem.c:147:22: note: ‘svn_data’ was previously declared here
147 | LITDEF svn_data_type svn_data[] =
| ^
/tmp/tmp/YDB/sr_port/op_close.c:27:18: warning: type of ‘active_device’ does not match original declaration [-Wlto-type-mismatch]
27 | GBLREF io_desc *active_device;
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:161:18: note: ‘active_device’ was previously declared here
161 | GBLDEF io_desc *active_device;
| ^
/tmp/tmp/YDB/sr_port/gbldefs.c:161:18: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
[ 89%] Built target libyottadb
Scanning dependencies of target dse
Scanning dependencies of target gtcm_pkdisp
Scanning dependencies of target yottadb
Scanning dependencies of target dbcertify
Scanning dependencies of target lke
Scanning dependencies of target mupip
Scanning dependencies of target gtmsecshr_real
[ 89%] Building C object CMakeFiles/dse.dir/sr_unix/dse.c.o
[ 89%] Building C object CMakeFiles/semstat2.dir/sr_unix/semstat2.c.o
[ 89%] Building C object CMakeFiles/gtcm_pkdisp.dir/sr_unix_cm/gtcm_pkdisp.c.o
...

K.S. Bhaskar

unread,
Oct 4, 2021, 3:13:18 PM10/4/21
to
Are you following the instructions in the README, or are you trying to compile it yourself with your own gcc flags? gcc flags do matter. Also, which Linux distribution/version are you using? Thank you.

Regards
– Bhaskar

K.S. Bhaskar

unread,
Oct 5, 2021, 11:30:11 AM10/5/21
to
Thank you for reporting this. For some reason, the great G is not showing your later post that you are compiling on Gentoo.

I just tried building r1.32 on Debian 11, one of the Supported platforms with gcc version 10.2.1 and it compiled without any warnings. There are many Linux distributions, many versions of gcc, and a plethora of compilation flags that control warnings. As newer versions of gcc generate more warnings, part of our development activity is to check those warnings, determine which are legitimate (and should be addressed) vs. those which are “check this out” (and should be suppressed with flags).

Regards
– Bhaskar

Сергей Каменев

unread,
Oct 6, 2021, 6:04:24 AM10/6/21
to
I incorrectly sent the answer to the mailing list from another email, so you did not see it.

Yes I followed instructions for gcc from README.
I'm using Calculate Linux Desktop (Gentoo based distro).
Kernel 5.10.32

As far as I remember, when compiling with an early version gcc 10.2.? (may be 10.2.1), there were also problems.

Sergey.

Сергей Каменев

unread,
Oct 7, 2021, 1:34:46 PM10/7/21
to
I tested compilation with gcc 10.2.0-r5. Same 10 warnings and notices.
Scanning dependencies of target dbcertify
Scanning dependencies of target dse
Scanning dependencies of target mupip

K.S. Bhaskar

unread,
Oct 11, 2021, 11:33:42 AM10/11/21
to
Different versions of compilers or even the same version of a compiler on different Linux distributions may generate different warnings for the same code. In some cases the warnings are correct and we take remedial action, and in some cases the warnings are not because there are reasons for the code being the way it is, and we have to add compiler flags to turn off a specific warning (and in some cases, if the flag is not available in an earlier version of a compiler, we may opt to not add the flag). This is an ongoing process that never stops.

What I would ask is that when you see a warning, please do investigate whether it appears legitimate. If it does, please submit a merge request on GitLab with a fix, and if it does not and there is a compiler flag to turn if off, please submit a merge request with the updated flag. Thank you.

Regards
– Bhaskar
0 new messages