« first day (1133 days earlier)      last day (2498 days later) » 

4:32 AM
@DrorK.: I found N983 from the WG14 Pre-Santa Cruz-2002 mailing‌​. It states that some C compilers somehow manage to put a FAM before the padding at the end of a structure. Do you have any insight into how that was/is possible? I'm trying to imagine a circumstance where that's possible.
 
@JonathanLeffler Morning
 
Worrabout struct fam1 { double d; char c; char fam[]; };? Assuming double requires 8-byte alignment (or 4-byte; it doesn't matter too much, but I'll stick with 8), then struct non_fam1a { double d; char c; }; would have 7 padding bytes after c. Further, struct non_fam1b { double d; char c; char nonfam[4]; }; would have 3 bytes padding after the nonfam array.
G'morning...
 
I'm not sure what do you mean by 'possible'? Don't you think it's better to potentially be able to utilize more storage?
 
Flip; the new MacBooks with the wretched ESC on the touch strip are not compatible with the way I dangle my fingers on the keyboard.
I keep losing stuff I've typed.
Pure aside, of course.
I'm not concerned with 'able to utilize more storage' yet. I'm worried about "WTF does it mean to have padding after a FAM when you've no idea how long the FAM is".
 
OH
These are not padding bytes after the actual array represented by the FAM
These are padding bytes after the offset of the FAM, within the struct object itself
 
4:40 AM
The suggestion is that the start of fam in struct fam1 can be at offset 9, even though sizeof(struct fam1) is 16. So that the bytes after c are not padding (necessarily).
Is that what we're both saying?
 
Yes
 
So, for a small enough FAM, the size of the struct plus FAM might still be less than size of struct fam.
 
Correct
 
OK. The prototypical allocation is malloc(sizeof(struct fam1) + array_size * sizeof(char)) when the FAM is of type char (as in struct fam1). That's a gross over-estimate when the offset of fam is less than sizeof(struct fam1).
Well, at least I was able, eventually, to devise what the trouble was.
 
:)
 
4:44 AM
And the grossness of the over-estimate depends on the value of array_size.
Thanks.
 
There are macros out there for calculating the 'precise' required storage
Based on FAM offsets that are less than the sizeof the struct
 
I don't tend to work on systems where that many bytes is a major issue — not in the embedded space.
I'm not convinced that Jens's example FAM is as compelling as mine. I'd expect uint64_t to require 8-byte (minimum 4-byte) alignment, so with 8-byte size_t, there'd be 4 bytes padding required with 8-byte alignment and none with 4-byte alignment. So I don't see that the offset of the FAM would be inside the size of the structure. Maybe I'm missing something still, or maybe he is.
 
I don't think that his sample is meant to present a worst case scenario, I think it's more of a sample of what a FAM is
 
 
2 hours later…
7:18 AM
It's not possible with system, unless you want to redirect the output to a file that you later read. That's it. End of story. Full stop. — Some programmer dude 59 secs ago
 
 
1 hour later…
8:38 AM
helloc all;
 
8:53 AM
Morning @PeterVaro
 
Why non-blocking? — Jonas 3 mins ago
XD
the OP is a little stupid :p
 
Nah, just confused
 
9:38 AM
8
Q: Why are the C and C++ ISO standards not publicly available?

jotikBeing mostly interested in the C and C++ standards, I wonder why programming language standards for ISO/IEC 23270:2006 C# and ISO/IEC 16262:2011 ECMAScript are publicly available from the ISO website, whereas standards for C and C++, and possibly other languages are not. What is the rationale beh...

Wow, 3 minutes +8...
 
-2
Q: Apache Thrift: multi-thread server for c glib

ray pixarthere is Apache Thrift C-glib tutorial which implemented simple server in single thread mode: c glib tutorial But I need a multi-thread server sample code. I've googled it but no result! Any suggestion or hint that help me to implement the multi-thread server are welcome. thanks

 
 
4 hours later…
1:35 PM
@PeterVaro You didn't say- have you written your own framework for unit testing?
 
1:53 PM
@DrorK. I'm still working on it :/ By the end of next week, there will be a POSIX only version available
wether it will support running test suites in parallel is depending on how much I will progress
 
@PeterVaro Oh, so you did respond!
 
accounts get locked. i press "Ask Question".. there is a message that says "it looks like you need to take a break". — user8237497 58 secs ago
And his/her question sucks...
 
2:22 PM
Good Afternoon.
 
Why do people hate PHP so much?
 
2:57 PM
i think bad design?
 
bad in everything
 
3:12 PM
This might be a stupid question, but why isn't char replaced with byte given it's always 1 byte anyways, and the contexts I find myself using it in almost make more sense when thinking of what I'm doing in terms of bytes?
 
3:28 PM
@Owatch Better question would be why char isn't required to represent 256 values, why its signedness implementation-defined ... etc etc, these are legacy things
 

« first day (1133 days earlier)      last day (2498 days later) »