Bug#517132: transcalc: Transcalc FTBFS with error "call to '__open_missing_mode' declared with attribute error"
Package: transcalc
Version: 0.14-3
Severity: serious
Tags: patch
Justification: no longer builds from source
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu jaunty ubuntu-patch
Hi,
When compiling with gcc 4.3, transcalc FTBFS because of a call to an open function with only 2 parameters:
make[3]: Entering directory `/build/buildd/transcalc-0.14/src'
cc -DHAVE_CONFIG_H -I. -I. -I.. -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -DDATADIR=\"/usr/share\" -ggdb -O2 -Wall -c transcalc.c
transcalc.c: In function 'read_config_file':
transcalc.c:182: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
transcalc.c:196: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result
transcalc.c:197: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result
transcalc.c:198: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result
In function 'open',
inlined from 'running_for_first_time' at transcalc.c:149:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[3]: *** [transcalc.o] Error 1
*** /tmp/tmptMRkaI
In Ubuntu, we've applied the attached patch to achieve the following:
* debian/patches/fix_FTBFS_gcc_4.3.patch: modify src/transcalc.c to fix a
FTBFS with gcc 4.3 in an open function (miss 3rd parameter)
* debian/rules: added include of /usr/share/cdbs/1/rules/simple-patchsys.mk
* Fix LP: #334035
We thought you might be interested in doing the same.
-- System Information:
Debian Release: 5.0
APT prefers jaunty-updates
APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.27-11-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
diff -u transcalc-0.14/debian/rules transcalc-0.14/debian/rules
--- transcalc-0.14/debian/rules
+++ transcalc-0.14/debian/rules
@@ -2,6 +2,7 @@
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
update-config::
[ -e docs/transcalc.1.d-r-orig ] || cp -p docs/transcalc.1 docs/transcalc.1.d-r-orig
only in patch2:
unchanged:
--- transcalc-0.14.orig/debian/patches/fix_FTBFS_gcc_4.3.patch
+++ transcalc-0.14/debian/patches/fix_FTBFS_gcc_4.3.patch
@@ -0,0 +1,11 @@
+--- transcalc-0.14.orig/src/transcalc.c
++++ transcalc-0.14/src/transcalc.c
+@@ -146,7 +146,7 @@
+ /* see if config file exists */
+ if (stat (config_filename, config_file_stat) != 0) {
+ /* config file missing, so touch it */
+- config_file_fd = open (config_filename, O_CREAT);
++ config_file_fd = open (config_filename, O_CREAT, 0644);
+ if (config_file_fd == -1)
+ {
+ perror ("open[config_file]");
Reply to: