warn « Cast « C Q&A

Home
C Q&A
1.assembly
2.buffer
3.Card
4.Cast
5.compile
6.console
7.const
8.constructor
9.database
10.Date
11.Debug
12.Design
13.Development
14.DLL
15.encrypt
16.enum
17.eof
18.Event
19.fork
20.Format
21.gcc
22.gdb
23.graph
24.graphics
25.gui
26.Holiday Event
27.image
28.IP
29.iterator
30.macro
31.makefile
32.malloc
33.Menu
34.mysql
35.network
36.openssl
37.operator
38.password
39.pipe
40.preprocessor
41.printf
42.pthread
43.Regular expression
44.scanf
45.semaphore
46.SerialPort
47.server
48.Socket
49.sql
50.SQLserver
51.sscanf
52.std
53.stdin
54.stdout
55.stl
56.strcmp
57.stream
58.switch
59.Template
60.thread
61.timer
62.unix
63.video
64.Virtual
65.visualstudio
66.winapi
67.windows
68.xml
C Q&A » Cast » warn 

1. Warning when casting from supposedly same size types    stackoverflow.com

I can't figure this warning out. It says I am casting a MY_KEY to a HKEY of greater size, but they would appear to be the same size (32 bits)?

//test.c
//compile as ...

2. warning while making cast    bytes.com

Hello, given a simple code: #include long hyp(long height, long base) { return sqrt(height * height + base * base); } int main(void) { long h = hyp(10, 20); return 0; } I compile this on Debian 4.0 (gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)): #gcc -ansi -pedantic -W -Wall -lm hyp.c As I understand, according to standard sqrt returns ...

3. HOWTO: Get Warning on implicit type casts that may lead to data loss    bytes.com

Hello everyone, I'm migrating a C++ program from 32-bit systems to 64-bit systems. The old programmers used some annoying assignments like assigning "long" to "int", which may lead to data loss. Is it possible to let the compiler (specifically, GCC) spew some warnings on this kind of implicit type casts? Or you suggest use some other static source codes analysis tools? ...

4. casting problems warnings segmentation fault.    cboard.cprogramming.com

casting problems warnings segmentation fault. Code: #include 2 #include 3 /* function prototypes */ 4 int printMenu(); 5 void printArray ( int [ ], int ); 6 int addInt ( int [ ], int, int); 7 int delINT ( int [ ], int, int); 8 int exists ( int [ ], int, int); 9 void insertSort ( int [ ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.