This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Modification required in cout function


On 6 January 2012 09:45, Jonathan Wakely wrote:
> On 6 January 2012 09:28, naveen yadav wrote:
>> Dear All,
>>
>> I want to modify cout source code in GCC such that it will not print
>> any thing on the screen.
>>
>> The reason is I have very large already compile code(distrubited in
>> lib form) and it is not possible to recompile. so i left with no
>> option but to modify in GCC code. Will you pls let me know where I can do it .
>
>
> Can't you just redirect the program's output to /dev/null when you run
> the program?
>
> Or close the file descriptor in your program's main() function?
>
> Or duplicate the file descriptor in main() to redirect the output to a file?

Or replace std::cout's streambuf with a different streambuf that
doesn't write to stdout.

I could probably think of more ways to do it without altering the
standard library.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]