Tutorial  Updated

How to make compiling neater

I was having trouble spotting any warnings because the output when compiling is so messy. Fixing that is pretty simple.

Why you should do it.
The warnings (and errors, if there were any) stick out like a sore thumb because they are so much longer. Take a look at the build output before and after following the instructions in this guide.
Before:
Code:
C:\projects\3ds\Pasta-CFW\CFW_loader>make
crypto.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/crypto.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/crypto.c -o crypto.o
draw.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/draw.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/draw.c -o draw.o
fs.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/fs.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c -o fs.o
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'DecryptPartition':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:95:9: warning: unused variable 'bytesWritten' [-Wunused-variable]
  size_t bytesWritten;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'InitializeNandCrypto':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:118:8: warning: unused variable 'listSystem' [-Wunused-variable]
  char* listSystem[] = { "4.x", "6.x", "7.x", "9.x" };
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:151:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:164:2: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:172:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:193:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:205:2: warning: implicit declaration of function 'sdmmc_sdcard_readsectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:213:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:226:2: warning: implicit declaration of function 'sdmmc_sdcard_writesectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_writesectors(sector_no + partition / 0x200, numsectors, out); //Stubbed, i don't wanna risk
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:166:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:187:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:207:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:227:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
hid.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/hid.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/hid.c -o hid.o
i2c.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/i2c.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/i2c.c -o i2c.o
c:/projects/3ds/Pasta-CFW/CFW_loader/source/i2c.c:6:43: warning: no semicolon at end of struct or union
static const struct { u8 bus_id, reg_addr } dev_data[] = {
  ^
main.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/main.c -o main.o
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c: In function 'CFW_NandDumper':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:299:23: warning: initialization makes pointer from integer without a cast
  unsigned char* buf = 0x21000000;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:319:5: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(count*nsectors, nsectors, buf);
  ^
platform.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/platform.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/platform.c -o platform.o
diskio.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/diskio.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs/diskio.c -o diskio.o
ff.c
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/ff.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=c99 -mthumb -mthumb-interwork -I/c/projects/3ds/Pasta-CFW/CFW_loader/include -I/c/projects/3ds/Pasta-CFW/CFW_loader/source -I/c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs  -I/c/projects/3ds/Pasta-CFW/CFW_loader/build -DARM9 -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/fatfs/ff.c -o ff.o
delay.s
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/delay.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/delay.s -o delay.o
start.s
arm-none-eabi-gcc -MMD -MP -MF /c/projects/3ds/Pasta-CFW/CFW_loader/build/start.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c /c/projects/3ds/Pasta-CFW/CFW_loader/source/start.s -o start.o
linking CFW_loader.elf
built ... CFW_loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.bin loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.elf loader.elf
After:
Code:
C:\projects\3ds\Pasta-CFW\CFW_loader>make
crypto.c
draw.c
fs.c
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'DecryptPartition':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:95:9: warning: unused variable 'bytesWritten' [-Wunused-variable]
  size_t bytesWritten;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'InitializeNandCrypto':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:118:8: warning: unused variable 'listSystem' [-Wunused-variable]
  char* listSystem[] = { "4.x", "6.x", "7.x", "9.x" };
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:151:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:164:2: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:172:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:193:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:205:2: warning: implicit declaration of function 'sdmmc_sdcard_readsectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_readsectors(sector_no + partition / 0x200, numsectors, out);
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:213:11: warning: assignment from incompatible pointer type
  info.ctr = &myCtr; info.buffer = out; info.size = numsectors * 0x200; info.keyY = NULL;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:226:2: warning: implicit declaration of function 'sdmmc_sdcard_writesectors' [-Wimplicit-function-declaration]
  sdmmc_sdcard_writesectors(sector_no + partition / 0x200, numsectors, out); //Stubbed, i don't wanna risk
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:166:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'nand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:187:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_readsectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:207:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c: In function 'emunand_writesectors':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/fs.c:227:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
hid.c
i2c.c
c:/projects/3ds/Pasta-CFW/CFW_loader/source/i2c.c:6:43: warning: no semicolon at end of struct or union
static const struct { u8 bus_id, reg_addr } dev_data[] = {
  ^
main.c
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c: In function 'CFW_NandDumper':
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:299:23: warning: initialization makes pointer from integer without a cast
  unsigned char* buf = 0x21000000;
  ^
c:/projects/3ds/Pasta-CFW/CFW_loader/source/main.c:319:5: warning: implicit declaration of function 'sdmmc_nand_readsectors' [-Wimplicit-function-declaration]
  sdmmc_nand_readsectors(count*nsectors, nsectors, buf);
  ^
platform.c
diskio.c
ff.c
delay.s
start.s
sdmc.s
linking CFW_loader.elf
built ... CFW_loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.bin loader.bin
cp /c/projects/3ds/Pasta-CFW/CFW_loader/CFW_loader.elf loader.elf
In addition to that, it's easy to see when there are no more warnings or errors. Here's a build where all the warnings have been fixed (different project):
Code:
C:\projects\3ds\3ds_hb_menu>make
app_bubble.bin
battery_charging.bin
battery_full.bin
battery_low.bin
battery_lowest.bin
battery_mid_high.bin
battery_mid_low.bin
bubble.bin
font.bin
installerIcon.bin
logo.bin
regionfree.bin
top_bar.bin
wifi_full.bin
wifi_none.bin
descriptor.cpp
tinyxml2.cpp
background.c
boot.c
error.c
filesystem.c
font.c
font1.c
font2.c
gfx.c
main.c
menu.c
netloader.c
regionfree.c
scanner.c
smdh.c
statusbar.c
text.c
titles.c
water.c
linking 3ds_hb_menu.elf
built ... 3ds_hb_menu.3dsx
A quick scroll through the output is all it takes to see that there are no warnings or errors.

How to do it
Making a clean output could hardly be simpler, and it isn't project-specific. All you need to do is open "C:\devkitPro\devkitARM\base_rules" with a text editor and replace the contents with this. It has no negative effects.
 
Last edited by JoostinOnline,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,033
Trophies
1
XP
2,622
Country
United States
This is completely the opposite of that. It makes spotting warnings easier. It hides the pointless commands. Read the first line of "Why you should do it".
Ahh... I see that makes sense. I did not realize the clean output at the end was after the fixing the warnings. I thought it was just hiding them.
 

mashers

Stubborn ape
Member
Joined
Jun 10, 2015
Messages
3,837
Trophies
0
Age
39
Location
Kongo Jungle
XP
5,054
Country
You can achieve the same result by using "make -s". It inhibits the echoing of the individual compiler commands so you can more easily see any errors and warnings.
 

JoostinOnline

Certified Crash Test Dummy
OP
Member
Joined
Apr 2, 2011
Messages
11,005
Trophies
1
Location
The Twilight Zone
Website
www.hacksden.com
XP
4,324
Country
United States
You can achieve the same result by using "make -s". It inhibits the echoing of the individual compiler commands so you can more easily see any errors and warnings.
True, but it has two downsides. The first is minor, in that you have to type -s every time. The second is bigger. You will have to modify every batch/bash script by adding a -s command, and the commands used in any tools if you compile through Programmer's Notepad.

This is a simple way that requires no changes to project files.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Will you give me mouth to mouth oxygen if my throat closes?
  • K3N1 @ K3N1:
    Nah the air can do that
  • K3N1 @ K3N1:
    Ask @x65943 he's trained for that stuff
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
    A @ abraarukuk: hi guys