Search Forums by tag:
Serial, mbed, compiler, ethernet, USB, I2C, SPI, interrupt, LCD, library, bug, HTTPServer, CAN, adc, AnalogIn, memory, SD Card, InterruptIn, rpc, Power, SDFileSystem, Ticker, canbus, driver, editor, Error, LocalFileSystem, UART, libraries, TCP, GPS, PwmOut, timer, pwm, file, website, accelerometer, C++, led, reset, SDCard, RTC, interrupts, clock, DigitalIn, TCPSocket, frequency, Java, http, buffer, DMA, SD, flash, HTTPClient, pinball, MODSERIAL, problem, printf, compile, filesystem, SerialPC, RFID, beta, LPC1768, rtos, newbie, digitalOut, Servo, UDP, audio, LPC11U24, RPCFunction, EthernetNetIf, NetServices, m3pi, Download, write, socket, multiple, array, sensor, keil, MATLAB, Forum, offline, debug, hardware, Board, I2S, dead, Sleep, xbee, Nokia6610, AnalogOut, tcp/ip, SPI Slave, code, voltage, wait, network, read, suggestion, dac, JTAG, string, pc, keyboard, copy, GPRS, lwip, Speed, DHCP, Data Logging, windows, time, current, MODDMA, mp3, C, gcc, attach, fatfilesystem, USB Host, publish, assembly, stepper motor, WavePlayer, camera, size, VGA, import, documentation, baud, bluetooth, TextLCD, firmware, M0, pullup, Relay, timing, pololu, MIDI, compiler error codes, magjack, client, robot, Communication, stream, HID, breakout, FIFO, prototype, GPIO, sampling, display, api, binary, filter, ADXL345, program, DSP, help, sram, class, suggestions, email, PING, arduino, rs232, link, wifi, Nokia, browser, control, Host, Eagle, Modbus, ide, linux, port, updates, Cortex-M0, WiFly, DMX, files, scanf, protocol, PPP, FTP, integer, function, latency, serial port, modem, motors, for, monitor, malloc, Digital I/O, Production, 7, keypad, FAT, classes, server, webserver, delay, variables, flashing, time-triggered, PCB, c programming, Analog, labview, watchdog, Encoder, post, math, LPCXpresso, MBED website, GSM, storage, nxp, mobileLCD, license, Terminal, int, counter, baseboard, rj45, EEPROM, E289, mac, Timeout, news, connect, pointers, Optocoupler, Robotics, search, USBMIDI, glitch, find, real-time, format, slave, driverlibrary, MODGPS, processing, networking, ID, umts, float, color, BUTTON, Images, wave, bin, const, OSX, supply, peripheral, sensors, touch, screen, RIT, character, bus, ARM, SRF08, heap, output, basic, piezo, pins, ID12, Pachube, player, DigitalInOut, object, capture, slow, PSP, OS, syntax, mbed.lib, EmbeddedArtists, NMEA, paste, project, GUI, UART0, firefox, motor, SQL, RAM, 3D, bugs, OLED, Temperature, not, I/O, Bidirectional, rss, resolved, Pin, Assembler, LED1, LIS302, getc, Safari, Vin, wiki, registers, PS2, fopen, BusOut, projects, RS485, pythonHi mbed team
I hope you don't mind if I bump this, I know there has been a lot of travelling and work back at base with the compiler as well.
Is it fair to say you are not supporting streams and other things that are possible in the compiler but not desirable on the platform?
Thanks
Daniel
Hi Daniel,
Whilst I wouldn't encourage streams (or use of any of the STL), we are not actively trying to stop/break them, so i'd consider this a bug. Note, the example can be simplified to the following and still generate the warning:
#include <iostream>
int main() {
std::cout << "Hello world\n";
}
I've filed a low priority ticket to look at this when appropriate, as it may be hiding something else and shouldn't be giving this behaviour.
Thanks,
Simon
Thanks Simon
I reckon using iostream is costing me 8000 bytes which is quite a lot out of my precious 32K. I need to work out if I'm going to have enough space for my code plus the lwip library, but have run into problems with using malloc to work that out (see here). Igor's python script is great but doesn't work with more than one library (mbed included). Any chance of those compiler stats yet?
Regards
Daniel
Please log in to post a reply.


I would like to use the cout stream (for some inline logging code) and found this code to redirect cout to stdio:
#include "mbed.h" #include <iostream> class OutputBuffer : public std::streambuf { public: OutputBuffer() { setp(0, 0); } virtual int_type overflow(int_type c = traits_type::eof()) { return fputc(c, stdout) == EOF ? traits_type::eof() : c; } }; int main() { printf("Hello world\n"); OutputBuffer ob; streambuf *sb = cout.rdbuf(&ob); cout << "Hello world again\n"; }It works, which is great, however the compiler generates some warning messages:
Are they indicative of a problem and could they be suppressed if not?
Thanks
Daniel