[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.


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


	  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’ 
  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,

More information about the buildroot mailing list