Comment 5 for bug 1123588

Revision history for this message
Matthias Klose (doko) wrote : Re: [4.7 Regression] wrong code with the fix for PR53844

according to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56301#c3 this is not an issue with GCC, but job_new shouldn't be marked with the malloc attribute. The following patch lets the test case pass without the GCC change reverted. Maybe other usages of the malloc attribute should be revisited.

 --- init/job.h.orig 2012-12-04 17:14:47.000000000 +0000
+++ init/job.h 2013-02-18 13:06:31.792691230 +0000
@@ -165,7 +165,7 @@
 NIH_BEGIN_EXTERN

 Job * job_new (JobClass *class, const char *name)
- __attribute__ ((warn_unused_result, malloc));
+ __attribute__ ((warn_unused_result));
 void job_register (Job *job, DBusConnection *conn, int signal);

 void job_change_goal (Job *job, JobGoal goal);