From owner-freebsd-questions@FreeBSD.ORG Sun May 31 23:23:25 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 892731065672 for ; Sun, 31 May 2009 23:23:25 +0000 (UTC) (envelope-from oxyd.oxyd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6078FC12 for ; Sun, 31 May 2009 23:23:24 +0000 (UTC) (envelope-from oxyd.oxyd@gmail.com) Received: by bwz9 with SMTP id 9so7334225bwz.43 for ; Sun, 31 May 2009 16:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:subject:from :content-type:mime-version:references:content-transfer-encoding :message-id:in-reply-to:user-agent; bh=N2O1y8Vp3uMhpbbUshWOHl1vcDxMdqAg0nVpcHjJ1zY=; b=TZNPLgykojQImNLc8LjxgMdiJIcWhIPC1hsPsy/K1Xbb4tsPeTo8cixujFYi9IkeyB KqlE/BfE+BQTujd6CKVbFLj3RpX+RmyNj21YskByxO8seKEKo8fgQpuWgmMVLTbF8M4p ACecaeI2lqsceGMxCp8CiUzw+DdA++DGoa6Vw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:subject:from:content-type:mime-version:references :content-transfer-encoding:message-id:in-reply-to:user-agent; b=x+V//yLRn9at631y7YGTdoJdsyHqZ6li4Be1PvCs1DsczRQSF1zHdeEsS09Ac4so9f 17Ty+n9e+hAYOKV8ZGY8NKjl1Cp6Xl0nCkalfIbyEgp7PpLT5jPQzCbjajM87QT6hYKs S+0w5JmcORhAnAaPohEbV8tRs3kI/zyi7Wpbw= Received: by 10.103.247.14 with SMTP id z14mr2943577mur.70.1243810430950; Sun, 31 May 2009 15:53:50 -0700 (PDT) Received: from localhost (adsl-static-82-202-0-211.praha.tiscali.cz [82.202.0.211]) by mx.google.com with ESMTPS id s10sm1383478mue.8.2009.05.31.15.53.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 31 May 2009 15:53:50 -0700 (PDT) Date: Mon, 01 Jun 2009 00:53:39 +0200 To: "Gary Kline" , "FreeBSD Mailing List" From: =?utf-8?B?T25kxZllaiBNYWplcmVjaA==?= Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20090531223136.GA9212@thought.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20090531223136.GA9212@thought.org> User-Agent: Opera Mail/9.64 (FreeBSD) Cc: Subject: Re: how to i designate the current function...? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 23:23:25 -0000 On Mon, 01 Jun 2009 00:31:40 +0200, Gary Kline wrote: > I'm not sure this is std yet, but think it is available in gcc. > If I'm calling funtion bar(char *, char) with one of the args > incorrect, is there a way to have gcc name bar() in an error message? > Are you looking for the __FUNCTION__ macro? void baz( char yes_no ) { if ( yes_no == 'Y' || yes_no == 'N' ) { // Do stuff... } else { printf( "%s: %s\n", __FUNCTION__, "I got an invalid arg" ); } } AFAIK, this isn't standard C, but well supported on GCC. Ondra