This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: is it a bug or am I dumb


John wrote:
I am not sure if this is a bug or not, but, it is driving me crazy!
It is a fault in your code.

ctest.c:23: warning: assignment makes pointer from integer without a cast
what is being assigned to? how can the assigned type have an integral
type?

>         if ( p = (char *) malloc( strlen( test_string ) + 1 ) != NULL )
what does your debugger tell the value of p is after this statement?
enlightenment should follow.


I have come to expect from the compilers I use on SCO Unix. I copied that
syntax from the book "The C Programming Language" by K & R.
No, you haven't :)

this is a C problem, not gcc.

nathan

--
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]