gcc 3.x에서 __FUNCTION__ warning

appkr의 이미지

지금 gcc 3.2를 사용하고 있는데 __FUNCTION__ define을 사용하면
deprecated라고 warning message가 나오는 군요.
(근데 실행해보면 함수이름은 제대로 나옵니다.)

컴파일 할때 저 warning message좀 안나오게 할 수 없나요?

컴파일할때 화면이 지저분해서.ㅋㅋㅋ

ps. 저거 많은 분들이 사용하는 define일텐데.. 나중에 없어지는 건가요?

appkr의 이미지

여러분들은 __FUNCTION__ define사용할 때 어떻게 사용하세요?

저는
printf(__FUNCTION__ "어쩌구");

이런 식으로 사용하는데,

printf("%s 어쩌구", __FUNCTION__); 만약 이렇게 사용했으면,

나중에 손봐야 할 곳이 많아지겠네요-_-

eek의 이미지

저두 gcc 3.2버젼 사용하고 있는 데요
그럼 문제가 아닐꺼 같네요. ^^;

#include <iostream.h>    // 이런 경우에 워닝이 발생하구요

#include <iostream>    // 이런 경우에 워닝이 사라집니다. 

및에 있는 것과 같은 워닝인 경우에 소스코드를 수정하고 싶지 않으시다면
컴파일옵션에 -Wno-deprecated를 부쳐주시면 됩니다.

/usr/local/include/c++/3.2.1/backward/backward_warning.h:32:2: warning: #warning
 This file includes at least one deprecated or antiquated header. Please conside
r using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Exa
mples include substituting the <X> header for the <X.h> header for C++ includes,
 or <sstream> instead of the deprecated header <strstream.h>. To disable this wa
rning use -Wno-deprecated.

그럼 수고하세요..

Perl 만세!!!!

Perl 만세~~~

appkr의 이미지

그 옵션은 C++의 경우에만 해당하고, C에서는 안되더군요.

익명 사용자의 이미지

appkr wrote:
지금 gcc 3.2를 사용하고 있는데 __FUNCTION__ define을 사용하면
deprecated라고 warning message가 나오는 군요.
(근데 실행해보면 함수이름은 제대로 나옵니다.)

컴파일 할때 저 warning message좀 안나오게 할 수 없나요?

컴파일할때 화면이 지저분해서.ㅋㅋㅋ

ps. 저거 많은 분들이 사용하는 define일텐데.. 나중에 없어지는 건가요?


printf(__FUNCTION__ ":\n");처럼 쓰지 말고
printf("%s:\n", __FUNCTION__);처럼 써야 합니다.
ageldama의 이미지

__FUNCTION__대신 __func__를 써보세요;;;

----
The future is here. It's just not widely distributed yet.
- William Gibson

익명 사용자의 이미지

ageldama wrote:
__FUNCTION__대신 __func__를 써보세요;;;

__func__는 문자열과 연결해서 쓸 수 없습니다. 즉
printf("%s:", __func__);는 되지만
printf(__func__ ":");는 안됩니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.