*BSD News Article 77305


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!inferno.mpx.com.au!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!howland.erols.net!vixen.cso.uiuc.edu!milo.mcs.anl.gov!maverick.mcs.anl.gov!balay
From: balay@maverick.mcs.anl.gov (Satish Balay)
Newsgroups: comp.unix.bsd.freebsd.misc,gnu.g++.help
Subject: g++2.7.2 error on freebsd
Date: Fri, 30 Aug 1996 20:14:14 GMT
Organization: Argonne National Laboratory, Chicago, Illinois
Lines: 36
Distribution: world
Message-ID: <8414360547401@maverick.mcs.anl.gov>
NNTP-Posting-Host: maverick.mcs.anl.gov
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:26433 gnu.g++.help:13194


Hi,

        I tried to compile this code on freebsd, and it dos'nt compile..
        What am I doing wrong? I'm using g++ -v 2.7.2

        I tried compiling using g++ 2.7.2 on sunOS and linux and other
        c++ compilers,and it works correctly..
        
        Any pointers would be helpful..

        Thanks

Satish Balay
(balay@mcs.anl.gov)
----------------------------------------


#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>


int NewPrintf(char *format,...)
{
  int rank;
  va_list Argp;
  FILE *fp;

  fp = fopen("x","w");
  va_start( Argp, format );
  vfprintf(fp,(char *)format,(void *)Argp); 
  va_end( Argp );
  fflush(stdout);
  return 0;
}