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
list
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
...failed
C++ emountd.o ...
...skipped emountd for lack of
emountd.o...
...failed updating 1 target(s)...
...skipped 1
target(s)...

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
// ...
LIBHAL_VOLUME_DISC_TYPE_HDDVDRW = 0x0f,
LIBHAL_VOLUME_DISC_TYPE_MO =
0x10,
} 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:

baju muslim modern 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.

HUBUNGI KAMI 24 JAM:
1. FB: Atharizky (https://www.facebook.com/ovi.indrihastuti)
2. FP: Grosir Mukena Daster Solo (https://www.facebook.com/mukenadastersolo/)
3. FP: Grosir Murah Daster dan Batik Solo (https://www.facebook.com/grosirmurahdastersolo/)
4. FP: Supplier/Grosir Mukena & Daster Solo (https://www.facebook.com/jualgrosirbatiksolo/)
5. Grup fb Grosir Murah Daster dan Batik Solo
6. Email: oviiee_indri@yahoo.co.id, oviieeindri2015@gmail.com
7. Pin BB: 7D07DD5A/5E527A1A
8. WA/Tlpn: :081.231.598.647 (SIMPATI).

Atau KUNJUNGI YOUTUBE KAMI di:
1. https://www.youtube.com/watch?v=1Xcjr_DK3_c&feature=youtu.be
2. https://www.youtube.com/watch?v=Sg3MHcC92Cw&feature=youtu.be
3. https://www.youtube.com/watch?v=Q1UcySi22oc&feature=youtu.be
4. https://www.youtube.com/watch?v=WSbVvGJMuMU&feature=youtu.be
5. https://www.youtube.com/watch?v=_fI-iB-Pd1o&feature=youtu.be
6. https://www.youtube.com/watch?v=iDjl03gMfpQ&feature=youtu.be
7. https://www.youtube.com/watch?v=5Ab94vg7OZ0&feature=youtu.be
8. https://www.youtube.com/watch?v=xJoK6a0dC-g&feature=youtu.be
9. https://www.youtube.com/watch?v=9MFuvzQh1qU&feature=youtu.be
10. https://www.youtube.com/watch?v=82cTikQFfkY&feature=youtu.be.

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