Help? Device driver 'make depend' errors from comments

2000-04-04 Thread Gary T. Corcoran

Since I received exactly ZERO responses to my plea for help in making
my network device driver a loadable module, I'm now trying to compile
my driver into the kernel.  

First, I made up a makefile and got my driver compiling cleanly
standalone in my directory.  So the code is known good with respect
to compiling under FreeBSD with gcc.  Then I moved the code under
the /sys hierarchy, fixed up my configuration file, and did a 'config'
for my kernel.  So far, so good.

But then when I moved to the compile directory and did a 'make depend',
all heck broke loose.  I'm getting hundreds of errors and/or warnings.
Checking the code, it seems to be complaining (or rather getting
confused) about two major things:

1. Comments following a #if or #ifdef, for example:
#ifdef FOO   // not yet tested
While this only generates a 'warning', I'm also getting actual
(supposed) errors about 'unbalanced #endif' and the like.  Though
it is possible these errors are related to problem number 2 instead:

2. It complains (doesn't say 'warning' so I suppose it takes them
as errors?) about "unterminated string or character constant"
whenever I have an apostrophe WITHIN A // COMMENT !!!  For example,
just including the word "don't" within a comment is causing problems.

So how do I "turn off" these "features" of 'make depend' ???  ;-)

Now this is a common codebase for this driver, which compiles fine
for Windows and Linux, and, as mentioned above, it compiles fine
(stand-alone) for FreeBSD.  So obviously it is syntactically-good
C code for gcc, so why am I having all these problems?  There are
over 50,000 lines of code, so please don't tell me to go changing
all the comments and #if lines!   Any (other :) suggestions
would be appreciated...

Thanks,
Gary
-- 
===
Gary Corcoran - Distinguished Member of Technical Staff
Lucent Microelectronics - Client Access Broadband Systems
   Communications Protocol & Driver Development Group
   "We make the drivers that make communications work"
  Email: [EMAIL PROTECTED]
---
There are only two kinds of machines - those that fail
little by little, and those that fail all at once.
===


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Help? Device driver 'make depend' errors from comments

2000-04-04 Thread Dan Moschuk


| First, I made up a makefile and got my driver compiling cleanly
| standalone in my directory.  So the code is known good with respect
| to compiling under FreeBSD with gcc.  Then I moved the code under
| the /sys hierarchy, fixed up my configuration file, and did a 'config'
| for my kernel.  So far, so good.
| 
| But then when I moved to the compile directory and did a 'make depend',
| all heck broke loose.  I'm getting hundreds of errors and/or warnings.
| Checking the code, it seems to be complaining (or rather getting
| confused) about two major things:

[ snip. ]

When you compile standalone, do you use the same -W options as the kernel
does when it compiles?  That may account for the millions of warnings you
getting when trying to build your driver with the regular kernel build.

Cheers,
-- 
Dan Moschuk ([EMAIL PROTECTED])
"Waste not fresh tears on old griefs."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Help? Device driver 'make depend' errors from comments

2000-04-04 Thread Mike Smith

> Since I received exactly ZERO responses to my plea for help in making
> my network device driver a loadable module, I'm now trying to compile
> my driver into the kernel.  

Go back to the module if this is for 4.x; I don't recall your original 
post, sorry, but feel free to pass it back off the list.

> Now this is a common codebase for this driver, which compiles fine
> for Windows and Linux, and, as mentioned above, it compiles fine
> (stand-alone) for FreeBSD.  So obviously it is syntactically-good
> C code for gcc, so why am I having all these problems?  There are
> over 50,000 lines of code, so please don't tell me to go changing
> all the comments and #if lines!   Any (other :) suggestions
> would be appreciated...

Oh joy.  It was probably written for MSVC in that case.  You're going to 
have to compile as a module in order to get different compiler warning 
flags; the code you're trying to build isn't really valid C and you'll 
have to work around this.

Please let us look at your module problems again, and poke me 
specifically about it if you're not getting answers.

-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  [EMAIL PROTECTED]
\\ and he'll hate you for a lifetime. \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Help? Device driver 'make depend' errors from comments

2000-04-04 Thread Gary T. Corcoran


Mike Smith wrote:

> Go back to the module if this is for 4.x;

I originally asked about making a network driver module for 3.4.
I was hoping for either a "here's how you do it" or at least an "it's
not possible with 3.4" response...

> > Now this is a common codebase for this driver, which compiles fine
> > for Windows and Linux, and, as mentioned above, it compiles fine
> > (stand-alone) for FreeBSD.  So obviously it is syntactically-good
> > C code for gcc, so why am I having all these problems?  There are
> > over 50,000 lines of code, so please don't tell me to go changing
> > all the comments and #if lines!   Any (other :) suggestions
> > would be appreciated...
> 
> Oh joy.  It was probably written for MSVC in that case.

How did you guess?...  ;-)  Yes, originally developed for Windows.
Ported to Linux (as a module) without many problems; now I'm the
"lone wolf" trying to add support for FreeBSD...

> You're going to have to compile as a module in order to get different
> compiler warning flags;

Okay - that's what I needed to know.  It looks like I should definitely
be targeting 4.x instead of 3.x. :(  I'll install 4.0, see if there are
any network driver module examples, and get back to you-all if I have
any more problems...

Thanks,
Gary


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message