Tagged Questions
0
votes
3answers
27 views
Compile Warnings while writing File, whats wrong?
I'm getting these compile warnings in my function and can't find any errors on my code:
warnings:
src.c: In function ‘writeFiles’:
src.c:119:18: warning: character constant too long for its type ...
0
votes
2answers
40 views
Why I got these warnings?
The compiler showed the following warnings for the following code segment. Please help me correct it.
if((tmp_n = (struct dot *)shmat(shm_net, NULL, 0)) == (int *) -1) { }
warning: comparison of ...
0
votes
1answer
20 views
Disable -Wreturn-type checking
I am trying to compile Model 5.0 under OS X 10.8.3
I am getting a lot of warnings and errors while compiling. Several of those error are something like
xwin.c:31523:2: error: non-void function ...
0
votes
0answers
57 views
Getting error in C, control reaches end of non-void function
Consider the following function:
off_t
func (const struct inode *inode)
{
off_t length = 0;
read_cache (&length, inode->sector, offsetof (struct inode_disk, length), sizeof (off_t));
...
1
vote
1answer
41 views
Suspcicious pointer conversion warning
I'm compiling my C code using Microchip's C18 compiler. I'm getting a warning [2054] suspicious pointer conversion in this code:
unsigned char ENC_MAADR1 = 0x65;
unsigned char ...
1
vote
1answer
49 views
How can I surpress GCC warnings for no prototypes for interrupt routines when -Wmissing-prototypes is used?
I'm writing embedded code in C using MPLABX (IDE for Microchip products) and the XC16 compiler (which is based on GCC).
I'm using -Wmissing-prototypes to make sure that I have prototypes for all of ...
1
vote
2answers
117 views
‘noreturn’ function does return
I have a weird warning:
‘noreturn’ function does return. THis is the function:
void hello(void){
int i;
i=1;
}
Why could it be happen?
All the call to this function is hello();
EDIT:
The all ...
1
vote
1answer
90 views
CodeWarrior compiler warning: “Possible loss of data”
Please consider the following code:
unsigned int beta;
unsigned int theta;
unsigned int m = 4;
unsigned int c = 986;
unsigned int Rpre = 49900;
unsigned int getUAnalog(unsigned char channel) ...
1
vote
1answer
82 views
Compiler gets warnings when using strptime function (C)
Typing man strptime it sais that this function needs to have declared _XOPEN_SOURCE and included time.h header. I did it. But, when I try to compile my code I get:
./check.c:56: warning: implicit ...
10
votes
3answers
170 views
Have compiler check the number of array initializers
Initializing an array (in C++, but any solution which works for C will likely work here as well) with less initializers than it has elements is perfectly legal:
int array[10] = { 1, 2, 3 };
...
0
votes
1answer
67 views
Am I losing information with this printf()?
In Expert C Programming, there is an exercise on page 146 that is supposed to illustrate how a typical Unix OS allocates various segments of an a.out file into various memory segments for execution.
...
2
votes
1answer
186 views
Compile C with function gethostbyname to static linked error
I'm trying compile program using function gethostbyname() with the cross compiler arm-none-linux-gnueabi, but it did not work when I run my binary on android.
My code in below:
/* ...
4
votes
2answers
156 views
Intel C++ Compiler warning 167 when non-const argument is passed as const parameter [duplicate]
I have a large codebase that recently moved from Microsoft's compiler to the Intel C++ Compiler. Our team's goal is compilation without warnings in the mainline. Since the switch, one instance of ...
0
votes
2answers
74 views
Using 64 bit integer iterator for 32 bit address space?
I'm writing some code (that runs on an FPGA) that writes a pattern to a block of memory specified by it's base address and highest address. The data width is 64 bits and the address space is 32 bits. ...
0
votes
0answers
91 views
intel compilers, silence commandline warnings
I just started building some code with the intel c compiler -- icc. Our configure script likes to add the -ffast-math flag and maybe a couple others which seem to be GCC specific. Invoking icc with ...