News for hackers. Stuff that matters.
Re:Automatic compilation of partially available C source code by Kenji on Friday April 21, 2017 @11:01AM (#14166171)
The header code generated contains

typedef int bool;

I am not sure if I want that in my header.

Re:Automatic compilation of partially available C source code by robotresearcher on Friday April 21, 2017 @11:32AM (#14166429)
What's the right type then? There is no bool type in C90. It appears in C99.

I've seen this in the wild, including the top answer on a StackOverflow question:

#define bool int

http://stackoverflow.com/questions/4159713/how-to-use-boolea...

Besides, if you want correct code, don't ask a tool to guess it! This tool is for patching up fragments enough to get them through the compiler front end analysis.

Re:Automatic compilation of partially available C source code by Buge on Friday April 21, 2017 @09:26PM (#14170650)
Well if you care about space efficiency, char is smaller than int.
Re:Automatic compilation of partially available C source code by unusualcool on Monday April 24, 2017 @08:57AM (#14183909)
Indeed, this can be an arguable choice. But notice the project is still in research, it's not an end-user product yet. Eventually, we'll offer options so the user can specifier whether he/she wants such a thing (or inference of standard/posix library functions, for example).
Re:Automatic compilation of partially available C source code by rfurmani on Friday April 21, 2017 @11:32AM (#14166425)
Why not? C does not have a book type and it is standard to use either char or int, depending on if you're concerned about space or about time.
Re:Automatic compilation of partially available C source code by sigjuice on Friday April 21, 2017 @11:56AM (#14166675)
C does have a bool type as well. I have not seen it used much in the C code that I have encountered. See http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdb...
Re:Automatic compilation of partially available C source code by mattkrause on Friday April 21, 2017 @01:23PM (#14167457)
It's "new" as of C99.

The actual boolean type is called _Bool, but <stdbool.h> provides macros that let bool, true, and false work.

Re:Automatic compilation of partially available C source code by euyyn on Friday April 21, 2017 @12:37PM (#14167088)
What I find weird is that it's not really used. Why generate bool, true, and false?
Re:Automatic compilation of partially available C source code by unusualcool on Monday April 24, 2017 @09:00AM (#14183930)
You're right, it's not always used. Please notice my other answer above, the project is still a prototype. Eventually, we'll filter what actually goes to the generated header and we'll allow the user to specify whether he/she wants bools, inference of C/POSIX library functions, etc.