[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Interesting new GCC warning (was Re: What's wrong with this dynamic mat
From: |
Paul E. Johnson |
Subject: |
Interesting new GCC warning (was Re: What's wrong with this dynamic matrix allocation |
Date: |
Fri, 19 Mar 1999 19:22:03 -0600 |
"Marcus G. Daniels" wrote:
>
> >>>>> "PJ" == Paul E Johnson <address@hidden> writes:
>
> PJ> Did you mean to imply that snippit runs without error for you?
>
> It happened to on Solaris.
>
> The bug in the program is that -createEnd doesn't return self.
>
Gosh darn it. You are right. Aside from "thinking hard and writing down
the answer," was there a method you used to spot that problem?
WHen I used egcs to compile the example test code you sent, I got a
warning I had never seen before. Have you seen this too? What do you
think?
main.m:1: warning: using `#import' is not recommended
The fact that a certain header file need not be processed more than once
should be indicated in the header file, not where it is used.
The best way to do this is with a conditional of this form:
#ifndef _FOO_H_INCLUDED
#define _FOO_H_INCLUDED
... <real contents of file> ...
#endif /* Not _FOO_H_INCLUDED */
Then users can use `#include' any number of times.
GNU C automatically avoids processing the file more than once
when it is equipped with such a conditional.
--
Paul E. Johnson email: address@hidden
Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66045 FAX: (785) 864-5700
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.