On Mon, Jun 24, 2019 at 4:41 AM Karel Zak <kzak@xxxxxxxxxx> wrote: > > On Sun, Jun 23, 2019 at 07:30:52PM -0300, unixmania@xxxxxxxxx wrote: > > Make the static declaration of the cmos_interface struct and related > > functions conditional to i386/x86_64, preventing several "defined but > > not used" compiler warnings. > > I think we have to be more aggressive :-) It would be better to: > > ./configure.ac: > * add --disable-hwclock-cmos > * add USE_HWCLOCK_CMOS (enabled by default for i386/x86_64) I don't know much about autoconf. How can I test the target architecture in config.ac. > * add define(USE_HWCLOCK_CMOS) > > sys-utils/Makemodule.am: > * compile hwclock-cmos.c only "if USE_HWCLOCK_CMOS" > > hwclock: > * remove all unnecessary #ifdefs from hwclock-cmos.c > * add #ifdef USE_HWCLOCK_CMOS to hwclock.c:determine_clock_access_method() > > > Note that we already use the same for RTC (which is linux only). > > The result will be more readable hwclock-cmos.c and only optional cmos > code compilation. I just sent a third version of the patch comprising all these changes except for the i386/x86_64 test. -- Carlos Santos <unixmania@xxxxxxxxx>