Hello Holger,
On Tue, 25 Jan 2011 16:51:02 +0100, "Holger Hans Peter Freyther" holger@freyther.de wrote:
Almost perfect. I can apply and modify myself or you could do two things. We tend to avoid the '//' comments, they were only added in C99 and used to be a GCC extension for C.
This is a good one ;-) One of the biggest problems when I tried a long time ago to compile any of OpenBSC or OsmocomBB with a different compiler than GCC were designated initializer which are _heavily_ used all over the sources (I don't question their advantage, I only mention it). They are a C99 feature (besides the library function snprintf() in the patch you commented). So I would not care about the '//', this was the smallest problem I had when I did my porting experiment (in fact the compilers I am aware of silently accept it).
Just out of interest, do we really want to to avoid C99 ? I know there is this implicit "kernel style" coding rule, does it include C99 ?
Please note that I don't want to discuss this, I use GCC from Cygwin and can find workarounds for Linux specific issues on Windows on my own, so I don't care that much. I am just interested in the reasons for using C99 or not.
Best regards, Dieter
On 01/25/2011 06:19 PM, Dieter Spaar wrote:
Hello Holger,
Hi Dieter,
On Tue, 25 Jan 2011 16:51:02 +0100, "Holger Hans Peter Freyther" holger@freyther.de wrote:
Almost perfect. I can apply and modify myself or you could do two things. We tend to avoid the '//' comments, they were only added in C99 and used to be a GCC extension for C.
This is a good one ;-)
hehe.
Just out of interest, do we really want to to avoid C99 ? I know there is this implicit "kernel style" coding rule, does it include C99 ?
seems to be just kernel style and not really related to C99.
Documentation/CodingStyle Linux style for comments is the C89 "/* ... */" style. Don't use C99-style "// ..." comments.
I am just interested in the reasons for using C99 or not.
That is a good question. The only practical thing would be C/C++ interworking as C++ still assumes a C89 environment, another one is that GCC still does not default to C99.
Hi,
On 25.01.2011 20:42, Holger Hans Peter Freyther wrote:
That is a good question. The only practical thing would be C/C++ interworking as C++ still assumes a C89 environment
But wasn't it C++ that implemented the //-style comments first, and C99 that added them for more C++ compatibility?
/* Regards, Steve */
On 01/25/2011 09:01 PM, Steve Markgraf wrote:
Hi,
On 25.01.2011 20:42, Holger Hans Peter Freyther wrote:
That is a good question. The only practical thing would be C/C++ interworking as C++ still assumes a C89 environment
But wasn't it C++ that implemented the //-style comments first, and C99 that added them for more C++ compatibility?
This was a general remark on C99 and C++. The current standard is only compatible with C89, only the upcoming C++ standard will add C99 support.
For all of our concerns it does not matter, in the worse case one has problems including our header files in C++ but then we can fix things.
i will try this with this device NL-402U ublox5 This Device should work out of the box with Linux see manuel http://www.navilock.de/view/PDFs/Linux_mit_uBlox/605
i've had similar problems with my sirf star III -based locosys btg-31. After looking at the source code i'd found the issue - only the the "GPGLL"-NMEA sentence was parsed.
Since my gps-device only supports GPGGA, GPRMC, GPGSA and GPGSV i've patched /src/host/layer23/src/common/gps.c to get the required data from GPGGA.
With that i'm also able to get "el-cheapo" support for gpsd (with help from socat and gpspipe):
/dev/ttyUSB0 // my gps-receiver device /dev/ttyACM0 // pseudo terminal (created with socat)
start gpsd and connect to the gps receiver # gpsd -N -n -D 4 /dev/ttyUSB0
create a pseudo terminal and feed it with the output of 'gpspipe -r' # socat -d -d pty,link=/dev/ttyACM0,raw,echo=0 "exec:gpspipe -r"
Now you can start cell_log and read the gps-data from the newly created pseudo terminal.
This is by no means a proper integration for gpsd as with libgps/libgpsd - but at least it works for me.
- Martin
Just out of interest, do we really want to to avoid C99 ? I know there is this implicit "kernel style" coding rule, does it include C99 ?
seems to be just kernel style and not really related to C99.
Documentation/CodingStyle Linux style for comments is the C89 "/* ... */" style. Don't use C99-style "// ..." comments.
The main advantage here is that a consistent commenting style helps readability IMO. When doing kernel code, I use '//' only for private TODO-areas, because it sticks out so much :)
Regards,
Wolfram
baseband-devel@lists.osmocom.org