public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* PROBLEM !!! __ OS: ANY LINUX __ COMPILERS: gcc & g++ __ OUTPUT: BAD!!!
@ 2023-03-16 17:44 oszibarack korte
  2023-03-16 17:49 ` Andrew Pinski
  2023-03-16 17:49 ` Jonathan Wakely
  0 siblings, 2 replies; 3+ messages in thread
From: oszibarack korte @ 2023-03-16 17:44 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]

*An unsolved problem for more than a decade!*
*Dear GNU Compiler Collection development team!*

*There is a problem with the gcc and g++ compilers for Linux operating
systems!*
*Here are 3 pieces of C and 3 pieces of C++ source code.*





*- Please compile them on any LINUX!- Run it!- Compare the output with the
corresponding source code!Summary:   THE OUTPUTS ARE BAD !!!*

*>>> C*

*1.*

// c0.c
// ENVIRONMENT: LINUX     COMPILER: gcc     OUTPUT: BAD !!!

#include <stdio.h>

void main (void)
{
   printf ("GNU Compiler Collection");

   while (1)
   {
       ;
   }
}


*2.*

// c1.c
// ENVIRONMENT: LINUX     COMPILER: gcc     OUTPUT: BAD !!!

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

void main (void)
{
   printf ("Hello!");

   system ("sleep 10");

   system ("clear");

   printf ("Goodbye!");
}


*3.*

// c2.c
// ENVIRONMENT: LINUX     COMPILER: gcc     OUTPUT: BAD !!!

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

void main (void)
{
   unsigned int   i;

   printf ("Now count up to 4.000.000.000. ST\nART! Wait...");

   for (i = 0; i < 4000000000; i++)
   {
      ;
   }

   printf ("READY!");

   system ("gcc --version");

   printf ("i = %u", i);

   system ("uname -a");
}


*>>> C++*

*1.*

// cpp0.cpp
// ENVIRONMENT: LINUX     COMPILER: g++     OUTPUT: BAD !!!

#include <iostream>

int main (void)
{
   std::cout << "GNU Compiler Collection";

   while (1)
   {
      ;
   }

   return 0;
}


*2.*

// cpp1.cpp
// ENVIRONMENT: LINUX     COMPILER: g++     OUTPUT: BAD !!!

#include <iostream>

int main (void)
{
   std::cout << "Hello!";

   system ("sleep 10");

   system ("clear");

   std::cout << "Goodbye!";

   return 0;
}


*3.*

// cpp2.cpp
// ENVIRONMENT: LINUX     COMPILER: g++     OUTPUT: BAD !!!

#include <iostream>

int main (void)
{
   unsigned int   i;

   std::cout << "Now count up to 4.000.000.000. ST\nART! Wait...";

   for (i = 0; i < 4000000000; i++)
   {
      ;
   }

   std::cout << "READY!";

   system ("g++ --version");

   std::cout << "i = " << i;

   system ("uname -a");

   return 0;
}



*Thank you,Best regards,*
korte.oszibarack
*March 16th, 2023*

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

* Re: PROBLEM !!! __ OS: ANY LINUX __ COMPILERS: gcc & g++ __ OUTPUT: BAD!!!
  2023-03-16 17:44 PROBLEM !!! __ OS: ANY LINUX __ COMPILERS: gcc & g++ __ OUTPUT: BAD!!! oszibarack korte
@ 2023-03-16 17:49 ` Andrew Pinski
  2023-03-16 17:49 ` Jonathan Wakely
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2023-03-16 17:49 UTC (permalink / raw)
  To: oszibarack korte; +Cc: gcc

On Thu, Mar 16, 2023 at 10:46 AM oszibarack korte via Gcc
<gcc@gcc.gnu.org> wrote:
>
> *An unsolved problem for more than a decade!*
> *Dear GNU Compiler Collection development team!*
>
> *There is a problem with the gcc and g++ compilers for Linux operating
> systems!*
> *Here are 3 pieces of C and 3 pieces of C++ source code.*

There is no bug here. stdout is line buffered.

Thanks,
Andrew

>
>
>
>
>
> *- Please compile them on any LINUX!- Run it!- Compare the output with the
> corresponding source code!Summary:   THE OUTPUTS ARE BAD !!!*
>
> *>>> C*
>
> *1.*
>
> // c0.c
> // ENVIRONMENT: LINUX     COMPILER: gcc     OUTPUT: BAD !!!
>
> #include <stdio.h>
>
> void main (void)
> {
>    printf ("GNU Compiler Collection");
>
>    while (1)
>    {
>        ;
>    }
> }
>
>
> *2.*
>
> // c1.c
> // ENVIRONMENT: LINUX     COMPILER: gcc     OUTPUT: BAD !!!
>
> #include <stdio.h>
> #include <stdlib.h>
>
> void main (void)
> {
>    printf ("Hello!");
>
>    system ("sleep 10");
>
>    system ("clear");
>
>    printf ("Goodbye!");
> }
>
>
> *3.*
>
> // c2.c
> // ENVIRONMENT: LINUX     COMPILER: gcc     OUTPUT: BAD !!!
>
> #include <stdio.h>
> #include <stdlib.h>
>
> void main (void)
> {
>    unsigned int   i;
>
>    printf ("Now count up to 4.000.000.000. ST\nART! Wait...");
>
>    for (i = 0; i < 4000000000; i++)
>    {
>       ;
>    }
>
>    printf ("READY!");
>
>    system ("gcc --version");
>
>    printf ("i = %u", i);
>
>    system ("uname -a");
> }
>
>
> *>>> C++*
>
> *1.*
>
> // cpp0.cpp
> // ENVIRONMENT: LINUX     COMPILER: g++     OUTPUT: BAD !!!
>
> #include <iostream>
>
> int main (void)
> {
>    std::cout << "GNU Compiler Collection";
>
>    while (1)
>    {
>       ;
>    }
>
>    return 0;
> }
>
>
> *2.*
>
> // cpp1.cpp
> // ENVIRONMENT: LINUX     COMPILER: g++     OUTPUT: BAD !!!
>
> #include <iostream>
>
> int main (void)
> {
>    std::cout << "Hello!";
>
>    system ("sleep 10");
>
>    system ("clear");
>
>    std::cout << "Goodbye!";
>
>    return 0;
> }
>
>
> *3.*
>
> // cpp2.cpp
> // ENVIRONMENT: LINUX     COMPILER: g++     OUTPUT: BAD !!!
>
> #include <iostream>
>
> int main (void)
> {
>    unsigned int   i;
>
>    std::cout << "Now count up to 4.000.000.000. ST\nART! Wait...";
>
>    for (i = 0; i < 4000000000; i++)
>    {
>       ;
>    }
>
>    std::cout << "READY!";
>
>    system ("g++ --version");
>
>    std::cout << "i = " << i;
>
>    system ("uname -a");
>
>    return 0;
> }
>
>
>
> *Thank you,Best regards,*
> korte.oszibarack
> *March 16th, 2023*

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

* Re: PROBLEM !!! __ OS: ANY LINUX __ COMPILERS: gcc & g++ __ OUTPUT: BAD!!!
  2023-03-16 17:44 PROBLEM !!! __ OS: ANY LINUX __ COMPILERS: gcc & g++ __ OUTPUT: BAD!!! oszibarack korte
  2023-03-16 17:49 ` Andrew Pinski
@ 2023-03-16 17:49 ` Jonathan Wakely
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2023-03-16 17:49 UTC (permalink / raw)
  To: oszibarack korte; +Cc: gcc

On Thu, 16 Mar 2023 at 17:45, oszibarack korte via Gcc <gcc@gcc.gnu.org> wrote:
>
> *An unsolved problem for more than a decade!*
> *Dear GNU Compiler Collection development team!*
>
> *There is a problem with the gcc and g++ compilers for Linux operating
> systems!*
> *Here are 3 pieces of C and 3 pieces of C++ source code.*
>
>
>
>
>
> *- Please compile them on any LINUX!- Run it!- Compare the output with the
> corresponding source code!Summary:   THE OUTPUTS ARE BAD !!!*

No, your programs are bad. You need to flush the output if you want it
to appear right away. When writing to standard output, a new line will
cause that to happen.

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

end of thread, other threads:[~2023-03-16 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 17:44 PROBLEM !!! __ OS: ANY LINUX __ COMPILERS: gcc & g++ __ OUTPUT: BAD!!! oszibarack korte
2023-03-16 17:49 ` Andrew Pinski
2023-03-16 17:49 ` Jonathan Wakely

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).