public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27255]  New: Including C++ header declares C functions
@ 2006-04-22  2:06 trentgamblin at hotmail dot com
  2006-04-22  2:09 ` [Bug c++/27255] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: trentgamblin at hotmail dot com @ 2006-04-22  2:06 UTC (permalink / raw)
  To: gcc-bugs

Including any C++ header puts all C functions in the global namespace. This
code compiles and runs without errors or warnings:

#include <iostream>

int main(void)
{
  printf("test\n");
}


-- 
           Summary: Including C++ header declares C functions
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: trentgamblin at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27255


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/27255] Including C++ header declares C functions
  2006-04-22  2:06 [Bug c++/27255] New: Including C++ header declares C functions trentgamblin at hotmail dot com
@ 2006-04-22  2:09 ` pinskia at gcc dot gnu dot org
  2006-04-22  3:23 ` trentgamblin at hotmail dot com
  2006-04-22  8:27 ` pcarlini at suse dot de
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-22  2:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-04-22 02:09 -------
Two things, first this is a dup of PR 6257 (which is one of the most report
bugs and that means is on http://gcc.gnu.org/bugzilla/duplicates.cgi, please
next time read that list).

Second, this might become valid to do, see:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#456

Which is an open defect agains the standard.

*** This bug has been marked as a duplicate of 6257 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27255


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/27255] Including C++ header declares C functions
  2006-04-22  2:06 [Bug c++/27255] New: Including C++ header declares C functions trentgamblin at hotmail dot com
  2006-04-22  2:09 ` [Bug c++/27255] " pinskia at gcc dot gnu dot org
@ 2006-04-22  3:23 ` trentgamblin at hotmail dot com
  2006-04-22  8:27 ` pcarlini at suse dot de
  2 siblings, 0 replies; 4+ messages in thread
From: trentgamblin at hotmail dot com @ 2006-04-22  3:23 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]



------- Comment #2 from trentgamblin at hotmail dot com  2006-04-22 03:23 -------
Subject: RE:  Including C++ header declares C functions

>Two things, first this is a dup of PR 6257 (which is one of the most report
>bugs and that means is on http://gcc.gnu.org/bugzilla/duplicates.cgi, 
>please
>next time read that list).
>
>Second, this might become valid to do, see:
>http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#456
>
>Which is an open defect agains the standard.

I don't think this is the same bug. I can see how including <cstdio> would 
declare printf but why in the world would including <iostream> or <vector> 
declare printf, strcpy, etc. Again, this is the code:

#include <vector>
int main(void)
{
  printf("test\n");
}

I didn't include any C headers at all. If I comment out the include 
statement GCC complains as it should. Please respond if you still think this 
is the same issue as bug 6257. Thanks for your time.

_________________________________________________________________
Powerful Parental Controls Let your child discover the best the Internet has 
to offer.  
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSN® Premium right now and get the 
first two months FREE*.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27255


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/27255] Including C++ header declares C functions
  2006-04-22  2:06 [Bug c++/27255] New: Including C++ header declares C functions trentgamblin at hotmail dot com
  2006-04-22  2:09 ` [Bug c++/27255] " pinskia at gcc dot gnu dot org
  2006-04-22  3:23 ` trentgamblin at hotmail dot com
@ 2006-04-22  8:27 ` pcarlini at suse dot de
  2 siblings, 0 replies; 4+ messages in thread
From: pcarlini at suse dot de @ 2006-04-22  8:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pcarlini at suse dot de  2006-04-22 08:27 -------
(In reply to comment #2)
> I don't think this is the same bug. I can see how including <cstdio> would 
> declare printf but why in the world would including <iostream> or <vector> 
> declare printf, strcpy, etc.

This is definitely allowed by the Standard. It's the same bug.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27255


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-22  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-22  2:06 [Bug c++/27255] New: Including C++ header declares C functions trentgamblin at hotmail dot com
2006-04-22  2:09 ` [Bug c++/27255] " pinskia at gcc dot gnu dot org
2006-04-22  3:23 ` trentgamblin at hotmail dot com
2006-04-22  8:27 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).