This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
volatile function
- From: kevin diggs <diggskevin38 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 24 Jan 2011 23:42:58 -0600
- Subject: volatile function
Hi,
I may be wearing out my welcome, but:
I tried to use (in a header file):
/**
* get_PLL: - return current value of PLL register (HID1)
*
* This returns the current value of the PLL configuration register (HID1).
*/
static inline volatile unsigned int get_PLL(void)
{
unsigned int ret;
__asm__ __volatile__ ("mfspr %0,%1":
"=r"(ret):
"i"(SPRN_HID1)
);
return ret;
}
to make sure that this function did not get moved or optimized away.
4.1.2 generated a warning (Linux kernel compile: warning -> error).
cc1: warnings being treated as errors
In file included from arch/powerpc/kernel/cpu/cpufreq/cf750gx.c:37:
/mnt/mnt3/linux-2.6.36/arch/powerpc/include/asm/pll.h:84: warning:
type qualifiers ignored on function return type
Thanks!
kevin