Bug 496362 - g_atomic_pointer_get() won't compile
g_atomic_pointer_get() won't compile
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glib2 (Show other bugs)
rawhide
ppc64 Linux
medium Severity medium
: ---
: ---
Assigned To: Matthias Clasen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-17 23:18 EDT by Mamoru TASAKA
Modified: 2009-04-18 00:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-17 23:29:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mamoru TASAKA 2009-04-17 23:18:12 EDT
Description of problem:
Trying to compile the following code (named as test-compile.c)
----------------------------------------------------
#include <glib.h>
#include <stdio.h>

int main(){
	int atomic = 0;
	if (g_atomic_pointer_get(&atomic))
		fprintf(stdout, "Hey!\n");
	return 0;
	
}
------------------------------------------------------
with
$ gcc $(rpm --eval %optflags) $(pkg-config --libs glib-2.0) \
      $(pkg-config --cflags glib-2.0) -o test-compile test-compile.c
succeeds on i586/x86_64/ppc, but on ppc64 this fails as:
------------------------------------------------------
++ pkg-config --libs glib-2.0
++ pkg-config --cflags glib-2.0
+ gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mminimal-toc -lglib-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -o trial-compile /builddir/build/SOURCES/trial-compile.c
/builddir/build/SOURCES/trial-compile.c: In function 'main':
/builddir/build/SOURCES/trial-compile.c:6: error: size of array 'type name' is negative
error: Bad exit status from /var/tmp/rpm-tmp.pjj1a0 (%prep)
------------------------------------------------------

Version-Release number of selected component (if applicable):
glib2-2.20.1-1.fc11

How reproducible:
100%
Comment 1 Matthias Clasen 2009-04-17 23:29:33 EDT
Try 

#include <glib.h>
#include <stdio.h>

int main(){
 gpointer atomic = NULL;
 if (g_atomic_pointer_get(&atomic))
  fprintf(stdout, "Hey!\n");
 return 0;

}
Comment 2 Mamoru TASAKA 2009-04-18 00:06:04 EDT
Oops, thank you.

Note You need to log in before you can comment on or make changes to this bug.