Typedef redeclaration -> Warning only ?

View: New views
4 Messages — Rating Filter:   Alert me  

Typedef redeclaration -> Warning only ?

by jnsagr01 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I wonder if there is an option for GCC to have multiple (and identical) typedef declarations only issue a warning instead of an error... I searched through the info-pages as on various forums/mailing lists but I didn't find any answer.
Do you know if such an option exists ?

Thanks

Nicolas

Re: Typedef redeclaration -> Warning only ?

by John (Eljay) Love-Jensen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nicolas,

C++ allows that.

C does not.

Can you use C++ and g++ instead of C and gcc?

Sincerely,
--Eljay

On 2/21/06 3:40 AM, "jnsagr01" <nico.joyard@...> wrote:

>
> Hi
>
> I wonder if there is an option for GCC to have multiple (and identical)
> typedef declarations only issue a warning instead of an error... I searched
> through the info-pages as on various forums/mailing lists but I didn't find
> any answer.
> Do you know if such an option exists ?
>
> Thanks
>
> Nicolas
> --
> View this message in context:
> http://www.nabble.com/Typedef-redeclaration--%3E-Warning-only--t1160845.html#a
> 3046880
> Sent from the gcc - Help forum at Nabble.com.
>


Re: Typedef redeclaration -> Warning only ?

by jnsagr01 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi and thanks for your answer.

Unfortunately I can't use C++ (I'm working in a big company on compilers for the
OS of mobiles phones, and they want to keep it pure C...). Isn't there an other
way to disable these errors ?

Sincerely,
Nicolas

John Love-Jensen <eljay@...> wrote:

> Hi Nicolas,
>
> C++ allows that.
>
> C does not.
>
> Can you use C++ and g++ instead of C and gcc?
>
> Sincerely,
> --Eljay
>
> On 2/21/06 3:40 AM, "jnsagr01" <nico.joyard@...> wrote:
>
> >
> > Hi
> >
> > I wonder if there is an option for GCC to have multiple (and identical)
> > typedef declarations only issue a warning instead of an error... I searched
> > through the info-pages as on various forums/mailing lists but I didn't find
> > any answer.
> > Do you know if such an option exists ?
> >
> > Thanks
> >
> > Nicolas
> > --
> > View this message in context:
> >
> http://www.nabble.com/Typedef-redeclaration--%3E-Warning-only--t1160845.html#a
> > 3046880
> > Sent from the gcc - Help forum at Nabble.com.
> >
>
>



Re: Typedef redeclaration -> Warning only ?

by John (Eljay) Love-Jensen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nicolas,

>Isn't there an other way to disable these errors ?

If you disable the errors, you fail to "keep it pure C".

My strong recommendation is to fix the errors.  Do not try to sweep them
under the rug by changing the language to "something that is very similar to
C, but is not C".  (That is to say, I discourage you making your own C-like
language just to patch some bad programming habits.)

Sincerely,
--Eljay