Search:

Type: Posts; User: aGerman

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. So, the reason why you consider to add a checksum...

    So, the reason why you consider to add a checksum is because you have a few unused bits in a structure? Hmm. Would you also consider to increase your structure to make room for a checksum if there...
  2. Maybe it will be better understood if you ignore...

    Maybe it will be better understood if you ignore both the semantics of pointers and what the standard says for a moment. The value of a pointer variable is a memory address in all implementations...
  3. Replies
    12
    Views
    5,649

    Don't focus too much on signedness. It's rather...

    Don't focus too much on signedness. It's rather about the method how signed integers are represented in a given implementation. The r?? are 64-bit, and the e?? are 32-bit registers. There is no such...
  4. Replies
    24
    Views
    9,590

    Oh, right. However, # is also a character with...

    Oh, right. However, # is also a character with special meaning in shell languages. It introduces comments for example in bash or PowerShell.
  5. Replies
    12
    Views
    5,649

    Due to my poor ASM knowledge I don't understand...

    Due to my poor ASM knowledge I don't understand why the high order bits of rdi are initialized. I would have expected to find a movsxd or something. But that's not the case.
  6. Replies
    24
    Views
    9,590

    You left out strspn in your example code, right?...

    You left out strspn in your example code, right?

    However, what shell do you use to call your program?
  7. Replies
    12
    Views
    5,649

    I absolutely agree! That was just to ensure we...

    I absolutely agree! That was just to ensure we don't accidentally leave out any warning option related to an implicit type conversion.


    By focusing on this assembly instruction, I wanted to...
  8. Replies
    12
    Views
    5,649

    Compiler Explorer can be enlightening. Compiler...

    Compiler Explorer can be enlightening.
    Compiler Explorer


    I used clang because it supports a lot more warnings than gcc and it has a -Weverything option to enable them all. As you can see the...
  9. Replies
    8
    Views
    5,552

    This might be an unfortunate choice then. Can't...

    This might be an unfortunate choice then. Can't you just wrap sem_open() then? As I said HANDLE is a pointer to an opaque object. So you won't ever find something that represents a sem_t-like object...
  10. Replies
    8
    Views
    5,552

    The HANDLE represents a pointer to an opaque...

    The HANDLE represents a pointer to an opaque object while sem_t is an (implementation-defined) object type. However, as to my knowledge you wouldn't ever use a variable of type sem_t on a POSIX...
  11. Replies
    3
    Views
    3,127

    Nope. "It also includes characters representing a...

    Nope. "It also includes characters representing a digit." '0' is just for the char with value 48. This can be a little confusing in the firs place :)


    Yup. ;)
  12. Replies
    3
    Views
    3,127

    scanf() tries to read whatever you specified. In...

    scanf() tries to read whatever you specified. In case of %c it reads the first char from stdin, regardless what character it is. So, if you hit the 0 key it reads char '0' and returns 1 because it...
  13. Also after reading twice it might be that we are...

    Also after reading twice it might be that we are trying to work around an XY problem. Terms like "text field" indicate it's about a kind of database. If so, isn't there something like "varchar" or...
  14. I don't know about the string types in this API....

    I don't know about the string types in this API. Assuming they are null-terminated strings of char and also assuming that you just want to divide it into chunks to save it and concatenate it again...
  15. FWIW For the sake of ease I've been not precise...

    FWIW For the sake of ease I've been not precise in both cases as I should have explained it as "array to pointer decay" when it gets passed to the parameter of memcpy.
  16. The address-of operator is not ignored at all....

    The address-of operator is not ignored at all. The name of an array denotes a pointer to its firest element. That makes that the address of the first element is the same as the address of the array....
  17. Replies
    2
    Views
    1,515

    Comarison operations yield an int with 0...

    Comarison operations yield an int with 0 representing logical false, and 1 (or any other value) representing logical true. You have to specify string literals that you conditionally pass to printf,...
  18. Replies
    8
    Views
    2,756

    Probably I would have used SendMessageTimeout()...

    Probably I would have used SendMessageTimeout() then :biggrin: However, I don't know if it works along with WM_QUIT as I didn't test.


    D'oh. I looked it up in the HRESULTs instead of the list of...
  19. Replies
    8
    Views
    2,756

    The return value for segfaults on Windows is ...

    The return value for segfaults on Windows is -1073741819 (0xC0000005). You can reproduce it with this line of code

    int main(void){ (void)(*(volatile char *)0 = 0); }
    Run the program in a cmd...
  20. Replies
    22
    Views
    5,857

    Sorry for not being clear enough. The malloc()...

    Sorry for not being clear enough. The malloc() and free() example has been my way to tell you that you just need to document what users of your lib have to take care. You can't take care of...
  21. Replies
    22
    Views
    5,857

    It's impossible to make sure that malloc() is...

    It's impossible to make sure that malloc() is used without free(). But it's contracted in the docs that the caller of malloc() is responsible to call free() for the deallocation. What did you...
  22. Replies
    22
    Views
    5,857

    Don't handle mutexes that you don't own, don't...

    Don't handle mutexes that you don't own, don't handle threads that you don't own. Return to the caller if you're done in your library code. Ensure you cleaned up the resources you own before you...
  23. Replies
    22
    Views
    5,857

    I don't know what library you're talking about...

    I don't know what library you're talking about and I don't know what influence you have in terms of the design of this library. However, I've literally never seen a code that has to count still...
  24. Replies
    22
    Views
    5,857

    I guess you have kind of a design issue if you...

    I guess you have kind of a design issue if you really have to count threads. Usually you would join them. Once all are joined you can release the resources used to synchronize things between the...
  25. Replies
    2
    Views
    1,112

    0x40 is a number with only the 7th bit set like...

    0x40 is a number with only the 7th bit set like ...0100 0000. The bitwise NOT flips all bits to ... 1011 1111. The bitwise AND removes the 7th bit from PCA0MD like it is set to 0 if it has been 1, or...
Results 1 to 25 of 57
Page 1 of 3 1 2 3