Fix misc. build warnings with gcc/clang in nightlies
Note this is a clone of !396 (closed) with the feature branch moved to the primary Allen repository, to resolve an issue with the pipelines not working for MRs derived from forks. See previous MR for full discussion.