🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fa.gcc
Article #1

__PRETTY_FUNCTION__ and getpid ()

#1
From: Alex Vinokur
Date: Thu, 21 Oct 1999 00:00
67 lines
1981 bytes

Hi,

__PRETTY_FUNCTION__ shows not getpid() but getpid()()
  while using it as default-value.

Is that correct?

        Alex


//#########################################################
//------------------- C++ code : BEGIN -------------------

#include <unistd.h>
#include <iostream>

void foo (int pid_i = getpid ())
{
        cout << __PRETTY_FUNCTION__ << endl;
}

int main ()
{
        foo ();
        return 0;
}

//------------------- C++ code : END ----------------------



//#########################################################
//------------------- Running Results : BEGIN -------------

void foo(int = getpid()())
// WHY NOT void foo(int = getpid()) ?

//------------------- Running Results : END ---------------







//#########################################################
//------------------- Environment -------------------------

g++ -v     : gcc version egcs-2.91.57 19980901
             (egcs-1.1 release)

uname -sr  : SunOS 5.6

//---------------------------------------------------------



//#########################################################



Sent via Deja.com http://www.deja.com/
Before you buy.

Technical Details
Message-ID: <7umtd8$rbi$1@nnrp1.deja.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-gnu.gcc.help.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <7umtd8$rbi$1@nnrp1.deja.com>
Subject: __PRETTY_FUNCTION__ and getpid ()
Date: Thu, 21 Oct 1999 00:00:00 +0000
From: Alex Vinokur <alexander.vinokur@telrad.co.il>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-gnu.gcc.help.mbox.zip!not-for-mail
X-Deja-AN: 538716078
X-Http-Proxy: 1.0 x34.deja.com:80 (Squid/1.1.22) for client 212.25.72.130
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Thu Oct 21 11:28:49 1999 GMT
X-MyDeja-Info: XMYDJUIDalexv7274
Newsgroups: gnu.g++.help,gnu.gcc.help,fa.gcc
X-Http-User-Agent: Mozilla/4.51 [en] (X11; I; SunOS 5.6 sun4m)