Opened 9 years ago

Closed 8 years ago

#917 closed defect (fixed)

tests that rely on diff break with clang

Reported by: Mario Domenech Goulart Owned by:
Priority: minor Milestone:
Component: unknown Version: 4.8.x
Keywords: scrutiny tests clang Cc:
Estimated difficulty:

Description (last modified by Mario Domenech Goulart)

Not a serious problem. clang generates some warnings that are not in the expected output files.

Warnings like:

../chicken.h:2292:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
../chicken.h:2299:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
../chicken.h:2336:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
../chicken.h:2344:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
4 warnings generated.

Attachments (2)

0001-chicken.h-define-C_noret-as-__attribute__-noreturn-f.patch (899 bytes) - added by Mario Domenech Goulart 9 years ago.
Patch submitted to chicken-hackers
0001-Silence-clang-return-type-warnings-by-removing-else-.patch (1.4 KB) - added by Jim Ursetto 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by Mario Domenech Goulart

Description: modified (diff)
Summary: scrutiny test breaks with clangtests that rely on diff break with clang

comment:2 Changed 9 years ago by Jim Ursetto

Not positive offhand, but IIRC this is because I had to remove "attribute noreturn" because clang was complaining about it. In terms of functionality it's ok but it is still suboptimal.

Changed 9 years ago by Mario Domenech Goulart

Patch submitted to chicken-hackers

comment:3 Changed 9 years ago by Jim Ursetto

The actual cause of this is the introduction of C_div_by_zero_error followed by an else clause in 4 places. Although legal with the noret attribute, I think it's cleaner (and silences the warnings even without noret) to remove the else. Patch attached.

comment:4 Changed 9 years ago by Jim Ursetto

That's not to say the noret patch is not necessary -- it is, and we should leave this ticket open for it -- but in the meantime, my patch is simple and kills a lot of compiler noise, without worrying about clang version.

comment:5 Changed 8 years ago by Jim Ursetto

Resolution: fixed
Status: newclosed

Was fixed in f89c875 (C_div_by_zero patch) prior to 4.8.0 release.

Note: See TracTickets for help on using tickets.