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.
Type: Posts; User: MartinR
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.
@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...
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...
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 ?
This is not about real time values but constants like IS_BIT_SET(255,8)
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...
Because
#define hook main
is used, and this is because
#ifndef PAL_INCLUDED
@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...
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...
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...
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...
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...
@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?
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?
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()...
@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...
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...
@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...
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...
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...
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;
@Niccolo but when I ask gcc to compile sing c11 it complains about unknown memcpy_s. So it is not defined.
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...
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...
@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...