This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
function attribute syntax question
- From: Per Bothner <per at bothner dot com>
- To: GCJ Java <java at gcc dot gnu dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 23 Jun 2004 15:29:37 -0700
- Subject: function attribute syntax question
libjava/jni.cc contains function definitions like the following:
static jint
(JNICALL _Jv_JNI_GetVersion) (JNIEnv *)
{
return JNI_VERSION_1_4;
}
which on MingGW expands to:
static int
(__attribute__((__stdcall__)) _Jv_JNI_GetVersion) (void)
{
return 0x00010004;
}
The attribute seems to be ignored, leading to
lots of pedwarns. My question is: *is* this syntax supposed
to be recognized? I.e. is this a C++ parser regression?
Removing the extra parentheses seems to fix the problem:
static jint JNICALL
_Jv_JNI_GetVersion (JNIEnv *)
{
return JNI_VERSION_1_4;
}
Since this is more readable anyway, it seems like the obvious fix,
though I'm puzzled as to what changed to break the existing code.
--
--Per Bothner
per@bothner.com http://per.bothner.com/