[Buildroot] NDEBUG breaks compilation of GCC 10

Andreas Ziegler br015 at umbiko.net
Mon Jun 14 09:22:23 UTC 2021


Dear all,

I seem to attract all the corner cases :-(

After the merge with the recent 'next' branch, compilation of GCC10 
breaks in the gcc-final step.

musl/assert.h:

	#ifdef NDEBUG
	#define	assert(x) (void)0
	#else
	#define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, 
__func__),0)))
	#endif

gcc/libgomp/target.c:

	{
	  struct target_mem_desc *k_tgt = k->tgt;
	  bool is_tgt_unmapped = gomp_remove_var (devicep, k);
	  /* It would be bad if TGT got unmapped while we're still iterating
	     over its LIST_COUNT, and also expect to use it in the following
	     code.  */
	  assert (!is_tgt_unmapped
		  || k_tgt != tgt);
	}

Build log:
../../../libgomp/target.c: In function ‘gomp_unmap_vars_internal’:
../../../libgomp/target.c:1474:9: error: unused variable 
‘is_tgt_unmapped’ [-Werror=unused-variable]
  1474 |    bool is_tgt_unmapped = gomp_remove_var (devicep, k);
       |         ^~~~~~~~~~~~~~~
../../../libgomp/target.c:1473:28: error: unused variable ‘k_tgt’ 
[-Werror=unused-variable]
  1473 |    struct target_mem_desc *k_tgt = k->tgt;
       |                            ^~~~~

Introducing -Wno-error=unused-variable seems to help, but maybe there is 
a better solution?

Kind regards,
Andreas


More information about the buildroot mailing list