Bug 496362

Summary: g_atomic_pointer_get() won't compile
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: glib2Assignee: Matthias Clasen <mclasen>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-18 03:29:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mamoru TASAKA 2009-04-18 03:18:12 UTC
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-18 03:29:33 UTC
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 04:06:04 UTC
Oops, thank you.