www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/10/11/16:18:05

From: pavenis AT lanet DOT lv
Message-ID: <B0000104749@stargate.astr.lu.lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Mon, 11 Oct 1999 20:43:35 +0300
MIME-Version: 1.0
Subject: Re: xmalloc and xfree
References: <B0000104742 AT stargate DOT astr DOT lu DOT lv>
In-reply-to: <Pine.SUN.3.91.991011185917.436B-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12a)
Reply-To: djgpp-workers AT delorie DOT com

On 11 Oct 99, at 19:02, Eli Zaretskii wrote:

> 
> On Mon, 11 Oct 1999 pavenis AT lanet DOT lv wrote:
> 
> > If You specify -ansi then -D__STRICT_ANSI__ is added to command 
> > line of cpp
> 
> Is -ansi used by default by the C++ compiler in v2.95.1?  I understood 
> previously that it was, but perhaps I misunderstood you, or confused 
> -ansi with some other similar option.

No it's not used by default.
> 
> > If You specify -fpedantic or -fpedantic-errors it's not added.
> 
> So what is the switch that triggers errors in C++ for functions without 
> prototypes?  Is it -fpedantic-errors or something else?
> 

C++ compiler silently defaults to -fpedantic-errors unless one (or both) 
of -fpedantic or -fpermissive is specified. It's in gcc/cp/decl.c 
(procedure init_decl_processing()):

  if (! flag_permissive && ! pedantic)
    flag_pedantic_errors = 1;

Non zero value of flag_fpedantic_errors tells compiler to generate 
errors on violations of standard.

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019