# Tons of warnings during a compilation



## dave-570 (May 5, 2015)

When I compile a port, I get hundreds of warning messages from the clang compiler. Is this normal and does anyone else get these?


----------



## kpa (May 5, 2015)

Post some examples of the warnings you're getting. It is sometimes normal to get quite a lot of warnings when compiling for example some very old code with the latest GCC or Clang. The compiler technology has improved considerably during the last 10 or so years and the compilers are now able to warn about many potential pitfalls that were silently ignored in the old days. The compilers also tend to be over enthusiastic about finding potential problems in the code. This is more of a consequence of C language being quite ambiguous in many areas than anything else.


----------



## wblock@ (May 5, 2015)

dave-570 said:


> Is this normal and does anyone else get these?


No.  Or maybe yes, given the total lack of information.  Which port?  On what version of FreeBSD?  Are there custom settings in /etc/make.conf?  What commands were used to build the port?  What are the errors, exactly?


----------



## dave-570 (May 10, 2015)

wblock@ said:


> No.  Or maybe yes, given the total lack of information.  Which port?  On what version of FreeBSD?  Are there custom settings in /etc/make.conf?  What commands were used to build the port?  What are the errors, exactly?


Sorry, but I said just warnings!! not errors. They are mostly deprecated compiler switches. After I posted this I compiled joe's own editor and found on closer inspection that they were mostly "notes". I have since built Apache-OpenOffice and although it took 10 hrs, it built without "error" and so far runs as expected. Thanks for your replies!! Actually you don't have enough room on this forum for all the warnings generated, so just pick a port and build it and watch the warnings fly by!!! PS. No special make switches and the command was `make install clean`


----------



## dave-570 (May 10, 2015)

kpa said:


> Post some examples of the warnings you're getting. It is sometimes normal to get quite a lot of warnings when compiling for example some very old code with the latest GCC or Clang. The compiler technology has improved considerably during the last 10 or so years and the compilers are now able to warn about many potential pitfalls that were silently ignored in the old days. The compilers also tend to be over enthusiastic about finding potential problems in the code. This is more of a consequence of C language being quite ambiguous in many areas than anything else.


Thanks for the reply. It seems as though they are mostly deprecated compiler switches! and Notes! Now I'm not a pro-programmer but it seems that some of this stuff could have been removed from the source code before released as a port. It would make cleaner code and the compiler wouldn't be spending as much of the resources displaying warnings to the screen. I'm not blaming, I'm just making and observation and if i had the time, I would fix what i could. I'm not a full time FreeBSD developer with all Apple's money. Some people on here seem to think we all should be!!


----------



## kpa (May 10, 2015)

dave-570 said:


> Thanks for the reply. It seems as though they are mostly deprecated compiler switches! and Notes! Now I'm not a pro-programmer but it seems that some of this stuff could have been removed from the source code before released as a port. It would make cleaner code and the compiler wouldn't be spending as much of the resources displaying warnings to the screen. I'm not blaming, I'm just making and observation and if i had the time, I would fix what i could. I'm not a full time FreeBSD developer with all Apple's money. Some people on here seem to think we all should be!!



Ideally the port maintainer would prepare a patch for the source code that fixes that compiler warnings while not breaking compatibility with the other OSes the source code is targeted for. He would then submit the patch to the upstream of the port to be included in the next release of the software reducing the need for FreeBSD specific patches. This doesn't work however for many ports because the upstream has no interest in supporting FreeBSD or the software in question is no longer developed but the last released version of it is still available.


----------

