tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How compiler & language versions relate to each other



How to test your package
========================

Testing for newer compiler versions
-----------------------------------

For maximum pain, during testing, you can use the following
in mk.conf, to ensure that the package will still build with
a newer GCC version:

CFLAGS+=	-std=gnu2x
CFLAGS+=	-Werror=implicit-function-declaration
CFLAGS+=	-Werror=implicit-int
CFLAGS+=	-Werror=incompatible-pointer-types

Personally I skip -Werror=no-incompatible[...], becuase
there's much lower hanging fruit to fix right now, and
pointer type compatibility requires much more thought.

For further ideas, see:
https://gcc.gnu.org/gcc-14/porting_to.html

These porting_to pages are your friend.
When all else fails,
FORCE_C_STD=	older-lang-ver
is your friend. Perferably a GNU variant, unless you
can predict exactly which APIs your package is using.

Testing for older compiler versions
-----------------------------------

Check your package's work/.work.log after a succesful
build. If you don't see 'std=' in the command line,
you need to set FORCE_C_STD or FORCE_CXX_STD
_and_ USE_CXX_FEATURES.

Start out with a lower standard (gnu99 etc).
If it fails, work your way up.


Home | Main Index | Thread Index | Old Index