Search:

Type: Posts; User: MartinR

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. The task is ill defined but it looks like they...

    The task is ill defined but it looks like they want you to go from whatever x down to 0. So yes you would need a loop.
  2. Replies
    8
    Views
    842

    @Salem, thanks for extended answer! The trick...

    @Salem, thanks for extended answer!

    The trick with

    typedef char static_assertion_##MSG[(COND)?1:-1]

    is nice and I saw it before in some legacy code. But shouldn't compiler complain about...
  3. Sorry for late response. Here is the output of...

    Sorry for late response.

    Here is the output of your prosed program


    $ gcc -Wall -O0 tmp.c -o tmp && time ./tmp.exe
    tmp.c: In function 'showDouble':
    tmp.c:16:23: warning: unknown conversion...
  4. Replies
    8
    Views
    842

    The usage is as I mention - the programmer will...

    The usage is as I mention - the programmer will always use the macro with constants known at compile time. Now the question is if we can verify them inside that #define ?
  5. Replies
    8
    Views
    842

    This is not about real time values but constants...

    This is not about real time values but constants like IS_BIT_SET(255,8)
  6. Replies
    8
    Views
    842

    Static assert of define

    Hi,

    I was wondering how can we extend simple macro like


    #define TOGGLE_BIT(x,y) \
    (x) ^= (1 << (y))


    with static assertion - i.e verify if y is within 32 bits as shifting beyound is...
  7. Replies
    15
    Views
    1,345

    Because #define hook main is used, and...

    Because


    #define hook main

    is used, and this is because



    #ifndef PAL_INCLUDED
  8. @Salem, thanks the -ffloat-store flag fixed the...

    @Salem, thanks the -ffloat-store flag fixed the issue. Now I wonder why, I read the documentation and it says that it prevent storing doubles in dedicated floating point registers which have more...
  9. Very weird issue with double to int conversion inside the loop

    Hi,

    I have spotted some piece of code which yields different result on addition of integers and doubles depending if it was performed in the loop or manually (+= vs + bare +).

    Here is the (not...
  10. Replies
    6
    Views
    860

    I figured that out eventually...ugh, the problem...

    I figured that out eventually...ugh, the problem is author describes code snippets and all of the sudden comes up with some *input* and *output* data example which can not be produced by this code he...
  11. Replies
    6
    Views
    860

    quick union algorithm confusion

    Hello,

    I read Algorithms in C (3rd edition) by R.Sedgewick and I am a bit confused about the very first algorithm in the book, which aims to store connections between different nodes - so if the...
  12. Its Audio DSP, yes it does support HW brakpoints....

    Its Audio DSP, yes it does support HW brakpoints. As for the custom handler, yes this is actaully a good idea - such handler could record all callers in some data structure (say a linked list) which...
  13. @Salem, the problem is I work with the firmware...

    @Salem, the problem is I work with the firmware on the embedded device - no OS no nothing. So I end up using GDB to trace calls...do you see any other way?
  14. Yeah and these function call graphs can't be...

    Yeah and these function call graphs can't be generated by any IDE right? Only the debugger (by means of a breakpoint) or somebody could generate it base on their experience?
  15. Why? I get into new project written in C++ and I...

    Why? I get into new project written in C++ and I try to get the code flow. For example I recognize some point in the program which I am sure will be called, lets call it
    classABC::functionABC()...
  16. @Salem, I gave visual studio a try and it looks...

    @Salem, I gave visual studio a try and it looks like it finds all occurences of the method no matter if a call or declaration not to mention a care of call on specific class....do you agree?

    Also...
  17. How to find all calls to a method of some class which has common name

    Hello,

    I have a C++/IDE question, let's say I have a class ABC which defines a method
    ABC::mandatoryMethod(...){} as the name of the function suggests all classes need to define it. Now, how do...
  18. @flp1969, yes you are right there are bugs, but I...

    @flp1969, yes you are right there are bugs, but I guess you realized this is a pseudo code to just ilustrate how the encoder works

    Anyway, I have fixed the bug, it was because sometimes GDB sends...
  19. Ubuntu 16.04. As for parameters of course I use...

    Ubuntu 16.04. As for parameters of course I use the original file and the one transfered over gdb, what else could I use?

    And what is md5sum returning? Of course md5 sum of each file, again what...
  20. Let me give you some more informations then. What...

    Let me give you some more informations then. What I do is write a stub for GDB - so it parses commands (packets) that GDB sends and responds accordingly. This particular problem is with GDB's "remote...
  21. "Unescaping" certain characters from binary file

    Hello,

    I have a binary file in which some bytes were escaped according to the following rule:


    if (byte == XX || byte == YY || ...)
    {
    temp = byte;
    byte = 0x7d;
    byte+1 = tmp ^ 0x20;
  22. Replies
    6
    Views
    2,947

    @Niccolo but when I ask gcc to compile sing c11...

    @Niccolo but when I ask gcc to compile sing c11 it complains about unknown memcpy_s. So it is not defined.
  23. Replies
    6
    Views
    2,947

    memcpy and its derivatives

    Hello,

    this subject is rather about memcpy_s which is known as secure copy because it actually check for null pointers and overlapping sections. However my first question would be where is it...
  24. Signed integer overflow - undefined behaviour

    Hello,

    as in subject the overflow of signed integers is defined as *undefined* - meaning that anything can happen including program crash. I think the *undefined* part comes from the fact that...
  25. Replies
    7
    Views
    1,779

    @narniat: thanks good list. However this is not...

    @narniat: thanks good list. However this is not exactly what I wanted to get. I am more interested in approaches. For example lets say you encountered a problem, you ran GDB to debug it and now - do...
Results 1 to 25 of 203
Page 1 of 9 1 2 3 4