Saturday, August 23, 2008

-pedantic anyone?

Everyone talks how C++ plays nicely with C? Of course it plays, until you engage somehow stricter validator in that compiler. After that, you are on your own...

During my recent emountd cooking (new EDE mount/unmount HAL-lified notify daemon) I was surprised that you will not be able to compile program that uses libhal with -pedantic flag: syntax error! Not to be expected for a product from people knowing their business...

I got this:

...found 95 target(s)...
...updating 2 target(s)...
C++ emountd.o
/usr/include/hal/libhal-storage.h:283: error: comma at end of enumerator
cc -c -o emountd.o -Wno-long-long -Wall -pedantic -g3 -D_DEBUG -I..
-I/opt/ede/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I. emountd.cpp
C++ emountd.o ...
...skipped emountd for lack of
...failed updating 1 target(s)...
...skipped 1

Hm, at first I was thinking compiler went nuts after 5 hour compile/recompile torture; you know, I get used to errors like this in my code, but in code residing in /usr/XXX... that is completely different thing.

So, quick peek in that libhal-storage.h, revealed this:

typedef enum {
// formatting mess so list is reduced
// ...
} LibHalVolumeDiscType;

See last LIBHAL_VOLUME_DISC_TYPE_MO and comma at the end? Well, both C and C++ standards said "no no" to that, and -pedantic is here to reminds you on that. Not only for these syntax changes, but for C/C++ difference too; at least those that C++ didn't adopted. The main example is long long type: not yet supported by C++ standard.

Not problem a much, except now you will not be able to compile D-BUS code with g++ and -pedantic! And long long is very much used in it.

Besides emountd, this problem I had in edelib too, at least in D-BUS binding code.

Possible solutions for this mess is to either forget on -pedantic or to add -Wno-long-long, where warnings/errors about non standard long long will be inhibited. Since I like -pedantic, you know what I went for.

Btw. just checked: that issue with libhal is fixed, so I'll have to think how to remove -pedantic in 0.5.9 version (not sure about previous/later). Ah, yes, we have autoconf for that :P

1 comment:

Unknown said...

AthaRizky menyediakan berbagai Baju MUSLIM Modern, JUAL Baju Grosir Murah, GROSIR Mukena Murah, Daster SOLO Murah, Grosir DASTER Solo, maupun baju biasa yang TRENDY dan UPDATE. banyak brand asli Indonesia yang kami sediakan dengan berbagai MODEL dan VARIASI terbaru yang tidak kalah dengan brand-brand luar. Serta kami menjual barang-barang yang MURAH MERIAH dan PAS DI KANTONG pelajar/mahasiswa/ibu rumahtangga.

1. FB: Atharizky (
2. FP: Grosir Mukena Daster Solo (
3. FP: Grosir Murah Daster dan Batik Solo (
4. FP: Supplier/Grosir Mukena & Daster Solo (
5. Grup fb Grosir Murah Daster dan Batik Solo
6. Email:,
7. Pin BB: 7D07DD5A/5E527A1A
8. WA/Tlpn: :081.231.598.647 (SIMPATI).


Baju BARU, Baju BARU Alhamdulillah, Baju MUSLIM Modern 2014, Baju PENGANTIN, Baju MUSLIM Modern 2014, BAJU Muslim Modern 2015, BAJU Merah
BAJU Muslim 2015, BAJU Muslim Pesta, BAJU Muslim Modern, BAJU Muslim Terbaru, BAJU Muslim TANAH Abang, BAJU Muslim Terkini
MODEL Baju Muslim TERBARU, Trend Baju MUSLIM 2014, TUTORIAL Baju Muslim, MODEL Baju Muslim WANITA Terbaru, gamis collection, supplier hijab solo, tokopakaian, pusatgrosir, batiksolo, distributor baju muslim murah, jilbab solo, gamis solo, distributor baju
model baju islami terbaru, model baju muslim yang terbaru, baju jilbab terbaru, baju muslim yg terbaru, lihat baju muslim terbaru
lihat model baju muslim terbaru, baju terbaru muslim, gaya baju muslim terbaru, baju muslim yang terbaru, baju busana muslim wanita terbaru, baju muslim terbaru murah
baju wanita muslim terbaru, cari baju muslim terbaru, baju muslim pesta terbaru, model baju dress muslim terbaru, jual baju muslim terbaru, baju muslim terbaru wanita
baju busana terbaru, baju muslim online terbaru, tren baju muslim terbaru, baju baju terbaru, model baju koko terbaru
fashion baju muslim terbaru, mode baju muslim terbaru, baju baju muslim terbaru, model baju busana muslim terbaru, model terbaru baju muslim, koleksi baju terbaru
baju muslim terbaru online, baju busana muslim terbaru, baju muslim terbaru 2014,baju muslim terbaru 2013, baju muslim model terbaru, baju muslim wanita terbaru