Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

[LINUX] icc does not recognize #define switch

$
0
0

Hello,

I am trying to compile an Android Kernel and got an error, which seems to be a fault of Intel ICC compiler semantics.

#define for_each_cpu_worker_pool(pool, cpu)				\
	for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0];		\
	     (pool) < &per_cpu(cpu_worker_pools, cpu)[NR_STD_WORKER_POOLS]; \
	     (pool)++)

Where in a code file we have this piece then:

for_each_cpu_worker_pool(pool, cpu)
	{
		WARN_ON_ONCE(cpu != smp_processor_id());

		mutex_lock(&pool->manager_mutex);
		spin_lock_irq(&pool->lock);

Which normally should be then replaced like this (plain and simple):

for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; (pool) < &per_cpu(cpu_worker_pools, cpu)[NR_STD_WORKER_POOLS]; (pool)++)
{
WARN_ON_ONCE(cpu != smp_processor_id());

		mutex_lock(&pool->manager_mutex);
		spin_lock_irq(&pool->lock);
...

But instead command line is throwing out this error:

workqueue.c(4989): error: expected a ")"
  		for_each_cpu_worker_pool(pool, cpu) {
                ^

 

Can I use some workaround to fix this?


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>